summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_x11.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-03-12 10:54:52 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-03-12 10:54:52 +0100
commitb9773f6eecea38e6a5aa28745cc6fe79aa2d441f (patch)
tree3740949c67bb6bfe533b35974f230c0443ce2c57 /plugingui/nativewindow_x11.cc
parent4bda33e204fafc4fdee6d14d5167ca7a801400ae (diff)
Add parent widget pointer for contained plugin windows. Remove threaded event handling and make all event handling depend on processEcvents being called with a regular (~50ms) interval.
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,