diff options
author | marha <marha@users.sourceforge.net> | 2010-09-20 09:22:54 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-09-20 09:22:54 +0000 |
commit | 97aaa22fb796662afd3ad4052d4f7d1c5945bb70 (patch) | |
tree | ba9fc06904f535fdda4336be7dda9ee180791914 /xorg-server/hw/xwin/winmultiwindowwindow.c | |
parent | 9cf4320c9d18406a570d4472cbf1fe3ceaeaf555 (diff) | |
download | vcxsrv-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.c | 28 |
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
{
|