diff options
Diffstat (limited to 'xorg-server/hw/xwin/glx/winpriv.c')
-rw-r--r-- | xorg-server/hw/xwin/glx/winpriv.c | 108 |
1 files changed, 100 insertions, 8 deletions
diff --git a/xorg-server/hw/xwin/glx/winpriv.c b/xorg-server/hw/xwin/glx/winpriv.c index 3260ca95c..671d81a5b 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); /** @@ -28,18 +30,31 @@ void winGetWindowInfo(WindowPtr pWin, winWindowInfoPtr pWinInfo) /* a real window was requested */ if (pWin != NULL) { + /* Initialize the size information */ + RECT rect = { + pWin->drawable.x, + pWin->drawable.y, + pWin->drawable.x + pWin->drawable.width, + pWin->drawable.y + pWin->drawable.height + }, rect_extends; /* Get the window and screen privates */ ScreenPtr pScreen = pWin->drawable.pScreen; winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); winScreenInfoPtr pScreenInfo = NULL; - if (pWinScreen == NULL) + rect_extends = rect; + OffsetRect(&rect_extends, -pWin->drawable.x, -pWin->drawable.y); + + if (pWinScreen == NULL) { ErrorF("winGetWindowInfo: screen has no privates\n"); return; } pWinInfo->hwnd = pWinScreen->hwndScreen; + pWinInfo->hrgn = NULL; + pWinInfo->rect = rect; + pScreenInfo = pWinScreen->pScreenInfo; #ifdef XWIN_MULTIWINDOW @@ -59,15 +74,85 @@ void winGetWindowInfo(WindowPtr pWin, winWindowInfoPtr pWinInfo) winCreateWindowsWindow(pWin); ErrorF("winGetWindowInfo: forcing window to exist...\n"); } - if (pWinPriv->hWnd != NULL) - { - /* copy window handle */ + { + /* copy size and window handle */ + pWinInfo->rect = rect_extends; pWinInfo->hwnd = pWinPriv->hWnd; - } + /* Copy window region */ + if (pWinPriv->hRgn) + { + if (!pWinInfo->hrgn) + { + pWinInfo->hrgn = CreateRectRgn(0,0,0,0); + } + CombineRgn(pWinInfo->hrgn, pWinPriv->hRgn, pWinPriv->hRgn, + RGN_COPY); + } + else if (pWinInfo->hrgn) + { + DeleteObject(pWinInfo->hrgn); + pWinInfo->hrgn=NULL; + } + + } + return; } + else if (g_fXdmcpEnabled) + { + winWindowPriv(pWin); + + if (pWinPriv == NULL) + { + ErrorF("winGetWindowInfo: window has no privates\n"); + return; + } + 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(WS_EX_TRANSPARENT, + WIN_GL_WINDOW_CLASS, + "", + WS_CHILD |WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ExtraClass, + pWin->drawable.x, + pWin->drawable.y, + pWin->drawable.width, + pWin->drawable.height, + pWinScreen->hwndScreen, + NULL, + GetModuleHandle(NULL), + NULL); + pWinPriv->GlCtxWnd=TRUE; + /* copy size and window handle */ + pWinInfo->hwnd = pWinPriv->hWnd; + } + else + { + pWinInfo->hwnd = pWinScreen->hwndScreen; + } + pWinInfo->rect = rect_extends; + if (pWinInfo->hrgn) + { + DeleteObject(pWinInfo->hrgn); + pWinInfo->hrgn = NULL; + } + } + else + { + pWinInfo->rect = rect_extends; + pWinInfo->hwnd = pWinPriv->hWnd; + pWinInfo->hrgn = NULL; + } + } #endif #ifdef XWIN_MULTIWINDOWEXTWM /* check for multiwindow external wm mode */ @@ -83,7 +168,8 @@ void winGetWindowInfo(WindowPtr pWin, winWindowInfoPtr pWinInfo) if (pRLWinPriv->hWnd != NULL) { - /* copy window handle */ + /* copy size and window handle */ + pWinInfo->rect = rect_extends; pWinInfo->hwnd = pRLWinPriv->hWnd; } return; @@ -92,18 +178,21 @@ void winGetWindowInfo(WindowPtr pWin, winWindowInfoPtr pWinInfo) } else { + RECT rect = {0, 0, 0, 0}; ScreenPtr pScreen = g_ScreenInfo[0].pScreen; winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); pWinInfo->hwnd = NULL; - + pWinInfo->hrgn = NULL; + pWinInfo->rect = rect; + if (pWinScreen == NULL) { ErrorF("winGetWindowInfo: screen has no privates\n"); return; } - ErrorF("winGetWindowInfo: returning root window\n"); + winDebug("winGetWindowInfo: returning root window\n"); pWinInfo->hwnd = pWinScreen->hwndScreen; } @@ -126,5 +215,8 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen) return TRUE; #endif + if (g_fXdmcpEnabled) + return TRUE; + return FALSE; } |