diff options
Diffstat (limited to 'xorg-server/hw/xwin/glx/winpriv.c')
-rw-r--r-- | xorg-server/hw/xwin/glx/winpriv.c | 120 |
1 files changed, 104 insertions, 16 deletions
diff --git a/xorg-server/hw/xwin/glx/winpriv.c b/xorg-server/hw/xwin/glx/winpriv.c index 4f6e4ffd5..1b8ec5a4a 100644 --- a/xorg-server/hw/xwin/glx/winpriv.c +++ b/xorg-server/hw/xwin/glx/winpriv.c @@ -11,6 +11,8 @@ #include "winpriv.h" #include "winwindow.h" +extern Bool g_fXdmcpEnabled; + void winCreateWindowsWindow(WindowPtr pWin); @@ -21,7 +23,8 @@ void HWND winGetWindowInfo(WindowPtr pWin) { - winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, pWin->drawable.id); + HWND hwnd = NULL; + winDebug("%s:%d pWin %p XID 0x%x\n", __FUNCTION__, __LINE__, pWin, pWin->drawable.id); /* a real window was requested */ if (pWin != NULL) { @@ -29,11 +32,10 @@ winGetWindowInfo(WindowPtr pWin) ScreenPtr pScreen = pWin->drawable.pScreen; winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); winScreenInfoPtr pScreenInfo = NULL; - HWND hwnd = NULL; if (pWinScreen == NULL) { ErrorF("winGetWindowInfo: screen has no privates\n"); - return NULL; + return hwnd; } hwnd = pWinScreen->hwndScreen; @@ -50,19 +52,103 @@ winGetWindowInfo(WindowPtr pWin) } if (pWinPriv->hWnd == NULL) { + if (pWin->parent && pWin->parent->parent) + { + int offsetx; + int offsety; + int ExtraClass=(pWin->realized)?WS_VISIBLE:0; + HWND hWndParent; + WindowPtr pParent=pWin->parent; + while (pParent) + { + winWindowPriv(pParent); + hWndParent=pWinPriv->hWnd; + if (hWndParent) + break; + pParent=pParent->parent; + } + if (!hWndParent) + hWndParent=hwnd; + if (pParent) + { + offsetx=pParent->drawable.x; + offsety=pParent->drawable.y; + } + else + { + offsetx=0; + offsety=0; + } + pWinPriv->hWnd=CreateWindowExA(0, + WIN_GL_WINDOW_CLASS, + "", + WS_CHILD |WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_DISABLED | ExtraClass, + pWin->drawable.x-offsetx, + pWin->drawable.y-offsety, + pWin->drawable.width, + pWin->drawable.height, + hWndParent, + NULL, + g_hInstance, + pWin); + 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->fWglUsed=TRUE; + } + else + { winCreateWindowsWindow(pWin); - ErrorF("winGetWindowInfo: forcing window to exist...\n"); + winDebug("winGetWindowInfo: forcing window to exist...\n"); + } } - if (pWinPriv->hWnd != NULL) { /* copy window handle */ hwnd = pWinPriv->hWnd; - - /* mark GLX active on that hwnd */ - pWinPriv->fWglUsed = TRUE; } + } + else if (g_fXdmcpEnabled) + { + winWindowPriv(pWin); - return hwnd; + if (pWinPriv == NULL) + { + ErrorF("winGetWindowInfo: window has no privates\n"); + return hwnd; + } + if (pWinPriv->hWnd == NULL) + { + if (!((pWin->drawable.x==0) && + (pWin->drawable.y==0) && + (pWin->drawable.width==pScreen->width) && + (pWin->drawable.height==pScreen->height) + ) + ) + { + int ExtraClass=(pWin->realized)?WS_VISIBLE:0; + pWinPriv->hWnd=CreateWindowExA(0, + WIN_GL_WINDOW_CLASS, + "", + WS_CHILD |WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_DISABLED | ExtraClass, + pWin->drawable.x, + pWin->drawable.y, + pWin->drawable.width, + pWin->drawable.height, + pWinScreen->hwndScreen, + NULL, + g_hInstance, + pWin); + pWinPriv->fWglUsed=TRUE; + /* copy size and window handle */ + hwnd = pWinPriv->hWnd; + } + else + { + hwnd = pWinScreen->hwndScreen; + } + } + else + { + hwnd = pWinPriv->hWnd; + } } #endif #ifdef XWIN_MULTIWINDOWEXTWM @@ -73,14 +159,12 @@ winGetWindowInfo(WindowPtr pWin) if (pRLWinPriv == NULL) { ErrorF("winGetWindowInfo: window has no privates\n"); - return hwnd; } if (pRLWinPriv->hWnd != NULL) { /* copy window handle */ hwnd = pRLWinPriv->hWnd; } - return hwnd; } #endif } @@ -90,15 +174,16 @@ winGetWindowInfo(WindowPtr pWin) if (pWinScreen == NULL) { ErrorF("winGetWindowInfo: screen has no privates\n"); - return NULL; } + else + { + winDebug("winGetWindowInfo: returning root window\n"); - ErrorF("winGetWindowInfo: returning root window\n"); - - return pWinScreen->hwndScreen; + hwnd=pWinScreen->hwndScreen; + } } - return NULL; + return hwnd; } Bool @@ -117,5 +202,8 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen) return TRUE; #endif + if (g_fXdmcpEnabled) + return TRUE; + return FALSE; } |