Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/intern/GHOST_WindowX11.cpp')
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp67
1 files changed, 52 insertions, 15 deletions
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index a98a59377c7..7b0606c40b7 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -138,6 +138,7 @@ GHOST_WindowX11(
GHOST_TUns32 width,
GHOST_TUns32 height,
GHOST_TWindowState state,
+ const GHOST_TEmbedderWindowID parentWindow,
GHOST_TDrawingContextType type,
const bool stereoVisual
) :
@@ -205,21 +206,57 @@ GHOST_WindowX11(
// create the window!
- m_window =
- XCreateWindow(
- m_display,
- RootWindow(m_display, m_visual->screen),
- left,
- top,
- width,
- height,
- 0, // no border.
- m_visual->depth,
- InputOutput,
- m_visual->visual,
- CWBorderPixel|CWColormap|CWEventMask,
- &xattributes
- );
+ ;
+ if (parentWindow == 0) {
+ m_window =
+ XCreateWindow(
+ m_display,
+ RootWindow(m_display, m_visual->screen),
+ left,
+ top,
+ width,
+ height,
+ 0, // no border.
+ m_visual->depth,
+ InputOutput,
+ m_visual->visual,
+ CWBorderPixel|CWColormap|CWEventMask,
+ &xattributes
+ );
+ } else {
+
+ Window root_return;
+ int x_return,y_return;
+ unsigned int w_return,h_return,border_w_return,depth_return;
+ GHOST_TInt32 screen_x, screen_y;
+
+ XGetGeometry(m_display, parentWindow, &root_return, &x_return, &y_return,
+ &w_return, &h_return, &border_w_return, &depth_return );
+
+ left = 0;
+ top = 0;
+ width = w_return;
+ height = h_return;
+
+
+ m_window = XCreateWindow(
+ m_display,
+ parentWindow, // reparent against embedder
+ left,
+ top,
+ width,
+ height,
+ 0, // no border.
+ m_visual->depth,
+ InputOutput,
+ m_visual->visual,
+ CWBorderPixel|CWColormap|CWEventMask,
+ &xattributes
+ );
+
+ XSelectInput(m_display , parentWindow, SubstructureNotifyMask);
+
+ }
// Are we in fullscreen mode - then include