aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/glx/winpriv.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/glx/winpriv.c')
-rw-r--r--xorg-server/hw/xwin/glx/winpriv.c74
1 files changed, 60 insertions, 14 deletions
diff --git a/xorg-server/hw/xwin/glx/winpriv.c b/xorg-server/hw/xwin/glx/winpriv.c
index a35392b26..ea7ff0717 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);
/**
@@ -19,7 +21,8 @@ winCreateWindowsWindow (WindowPtr pWin);
*/
HWND winGetWindowInfo(WindowPtr pWin)
{
- winDebug("%s: pWin=%p\n", __FUNCTION__, pWin);
+ HWND hwnd = NULL;
+ winDebug("%s:%d pWin=%p\n", __FUNCTION__, __LINE__, pWin);
/* a real window was requested */
if (pWin != NULL)
@@ -28,12 +31,11 @@ HWND 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;
@@ -56,14 +58,56 @@ HWND winGetWindowInfo(WindowPtr pWin)
winCreateWindowsWindow(pWin);
ErrorF("winGetWindowInfo: forcing window to exist...\n");
}
-
if (pWinPriv->hWnd != NULL)
- {
+ {
/* copy window handle */
hwnd = pWinPriv->hWnd;
- }
+ }
+ }
+ 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(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 */
+ hwnd = pWinPriv->hWnd;
+ }
+ else
+ {
+ hwnd = pWinScreen->hwndScreen;
+ }
+ }
+ else
+ {
+ hwnd = pWinPriv->hWnd;
+ }
}
#endif
#ifdef XWIN_MULTIWINDOWEXTWM
@@ -75,7 +119,6 @@ HWND winGetWindowInfo(WindowPtr pWin)
if (pRLWinPriv == NULL) {
ErrorF("winGetWindowInfo: window has no privates\n");
- return hwnd;
}
if (pRLWinPriv->hWnd != NULL)
@@ -83,7 +126,6 @@ HWND winGetWindowInfo(WindowPtr pWin)
/* copy window handle */
hwnd = pRLWinPriv->hWnd;
}
- return hwnd;
}
#endif
}
@@ -95,15 +137,16 @@ HWND 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
@@ -122,5 +165,8 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen)
return TRUE;
#endif
+ if (g_fXdmcpEnabled)
+ return TRUE;
+
return FALSE;
}