aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowwindow.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-20 09:22:54 +0000
committermarha <marha@users.sourceforge.net>2010-09-20 09:22:54 +0000
commit97aaa22fb796662afd3ad4052d4f7d1c5945bb70 (patch)
treeba9fc06904f535fdda4336be7dda9ee180791914 /xorg-server/hw/xwin/winmultiwindowwindow.c
parent9cf4320c9d18406a570d4472cbf1fe3ceaeaf555 (diff)
downloadvcxsrv-97aaa22fb796662afd3ad4052d4f7d1c5945bb70.tar.gz
vcxsrv-97aaa22fb796662afd3ad4052d4f7d1c5945bb70.tar.bz2
vcxsrv-97aaa22fb796662afd3ad4052d4f7d1c5945bb70.zip
opengl window was not always created/moved to the correct place
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwindow.c')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwindow.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c
index 44fdd8ac3..5e8c51c30 100644
--- a/xorg-server/hw/xwin/winmultiwindowwindow.c
+++ b/xorg-server/hw/xwin/winmultiwindowwindow.c
@@ -636,17 +636,37 @@ winUpdateWindowsWindow (WindowPtr pWin)
}
else if (hWnd != NULL)
{
- if (pWinPriv->OpenGlWindow)
+ if (pWinPriv->GlCtxWnd)
{
+ /* We do not need to destroy the window but to reparent it and move it to the
+ correct place when it is an opengl window */
+ int offsetx;
+ int offsety;
HWND hParentWnd;
+ WindowPtr pParent=pWin->parent;
+ while (pParent)
{
- winWindowPriv(pWin->parent);
- ErrorF("Window handle = %x\n",pWinPriv->hWnd);
+ winWindowPriv(pParent);
hParentWnd=pWinPriv->hWnd;
+ if (hParentWnd)
+ break;
+ pParent=pParent->parent;
+ }
+
+ if (pParent)
+ {
+ offsetx=pParent->drawable.x;
+ offsety=pParent->drawable.y;
+ }
+ else
+ {
+ offsetx=0;
+ offsety=0;
}
+ winDebug ("-winUpdateWindowsWindow: %x changing parent to %x and moving to %d,%d\n",pWinPriv->hWnd,hParentWnd,pWin->drawable.x-offsetx,pWin->drawable.y-offsety);
SetParent(pWinPriv->hWnd,hParentWnd);
- SetWindowPos(pWinPriv->hWnd,NULL,0,0,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_SHOWWINDOW);
+ SetWindowPos(pWinPriv->hWnd,NULL,pWin->drawable.x-offsetx,pWin->drawable.y-offsety,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_SHOWWINDOW);
}
else
{