summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_x11.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/nativewindow_x11.cc')
-rw-r--r--plugingui/nativewindow_x11.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/plugingui/nativewindow_x11.cc b/plugingui/nativewindow_x11.cc
index ae1907c..8088d93 100644
--- a/plugingui/nativewindow_x11.cc
+++ b/plugingui/nativewindow_x11.cc
@@ -35,16 +35,10 @@
namespace GUI {
-NativeWindowX11::NativeWindowX11(Window& window)
+NativeWindowX11::NativeWindowX11(void* native_window, Window& window)
: buffer(nullptr)
, window(window)
{
- auto status = XInitThreads();
- if(status)
- {
- ERR(X11, "Could not initialise threaded Xlib calls (XInitThreads)");
- }
-
display = XOpenDisplay(nullptr);
if(display == nullptr)
{
@@ -57,12 +51,20 @@ NativeWindowX11::NativeWindowX11(Window& window)
// Get some colors
int blackColor = BlackPixel(display, screen);
- ::Window rootWindow = DefaultRootWindow(display);
+ ::Window parentWindow;
+ if(native_window)
+ {
+ parentWindow = (::Window)native_window;
+ }
+ else
+ {
+ parentWindow = DefaultRootWindow(display);
+ }
// Create the window
unsigned long border = 0;
xwindow = XCreateSimpleWindow(display,
- rootWindow,
+ parentWindow,
window.x(), window.y(),
window.width(), window.height(),
border,