From 97aaa22fb796662afd3ad4052d4f7d1c5945bb70 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 20 Sep 2010 09:22:54 +0000 Subject: opengl window was not always created/moved to the correct place --- xorg-server/hw/xwin/glx/winpriv.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'xorg-server/hw/xwin/glx/winpriv.c') diff --git a/xorg-server/hw/xwin/glx/winpriv.c b/xorg-server/hw/xwin/glx/winpriv.c index 6c16c31ae..c689bae08 100644 --- a/xorg-server/hw/xwin/glx/winpriv.c +++ b/xorg-server/hw/xwin/glx/winpriv.c @@ -57,6 +57,8 @@ HWND winGetWindowInfo(WindowPtr pWin) { if (pWin->parent && pWin->parent->parent) { + int offsetx; + int offsety; int ExtraClass=(pWin->realized)?WS_VISIBLE:0; HWND hWndParent; WindowPtr pParent=pWin->parent; @@ -70,24 +72,35 @@ HWND winGetWindowInfo(WindowPtr pWin) } if (!hWndParent) hWndParent=hwnd; + if (pParent) + { + offsetx=pParent->drawable.x; + offsety=pParent->drawable.y; + } + else + { + offsetx=0; + offsety=0; + } pWinPriv->hWnd=CreateWindowExA(WS_EX_TRANSPARENT, WIN_GL_WINDOW_CLASS, "", WS_CHILD |WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ExtraClass, - pWin->drawable.x, - pWin->drawable.y, + pWin->drawable.x-offsetx, + pWin->drawable.y-offsety, pWin->drawable.width, pWin->drawable.height, hWndParent, NULL, GetModuleHandle(NULL), NULL); + winDebug("Window created %x %x %d %d %d %d\n",pWinPriv->hWnd,hWndParent,pWin->drawable.x-offsetx,pWin->drawable.y-offsety,pWin->drawable.width, pWin->drawable.height); pWinPriv->GlCtxWnd=TRUE; } else { winCreateWindowsWindow(pWin); - ErrorF("winGetWindowInfo: forcing window to exist...\n"); + winDebug("winGetWindowInfo: forcing window to exist...\n"); } } if (pWinPriv->hWnd != NULL) -- cgit v1.2.3