aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowwindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwindow.c')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwindow.c297
1 files changed, 140 insertions, 157 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c
index 93434fceb..3044eda9c 100644
--- a/xorg-server/hw/xwin/winmultiwindowwindow.c
+++ b/xorg-server/hw/xwin/winmultiwindowwindow.c
@@ -78,7 +78,7 @@ void winInitMultiWindowClass(void)
wcx.hIconSm = g_hSmallIconX;
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X);
+ winDebug ("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X);
#endif
atomXWinClass = RegisterClassEx (&wcx);
@@ -98,7 +98,7 @@ winCreateWindowMultiWindow (WindowPtr pWin)
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
- winTrace ("winCreateWindowMultiWindow - pWin: %p\n", pWin);
+ winDebug ("winCreateWindowMultiWindow - pWin: %p\n", pWin);
#endif
WIN_UNWRAP(CreateWindow);
@@ -108,6 +108,7 @@ winCreateWindowMultiWindow (WindowPtr pWin)
/* Initialize some privates values */
pWinPriv->hRgn = NULL;
pWinPriv->hWnd = NULL;
+ pWinPriv->GlCtxWnd = FALSE;
pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
pWinPriv->fXKilled = FALSE;
@@ -128,7 +129,7 @@ winDestroyWindowMultiWindow (WindowPtr pWin)
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowMultiWindow - pWin: %p\n", pWin);
+ winDebug ("winDestroyWindowMultiWindow - pWin: %p\n", pWin);
#endif
WIN_UNWRAP(DestroyWindow);
@@ -165,32 +166,26 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
HWND hWnd = pWinPriv->hWnd;
RECT rcNew;
RECT rcOld;
-#if CYGMULTIWINDOW_DEBUG
+#ifdef WINDBG
RECT rcClient;
RECT *lpRc;
#endif
DWORD dwExStyle;
DWORD dwStyle;
-#if CYGMULTIWINDOW_DEBUG
- winTrace ("winPositionWindowMultiWindow - pWin: %p\n", pWin);
-#endif
+ winDebug ("winPositionWindowMultiWindow - pWin: %p\n", pWin);
WIN_UNWRAP(PositionWindow);
fResult = (*pScreen->PositionWindow)(pWin, x, y);
WIN_WRAP(PositionWindow, winPositionWindowMultiWindow);
-#if CYGWINDOWING_DEBUG
- ErrorF ("winPositionWindowMultiWindow: (x, y) = (%d, %d)\n",
+ winDebug ("winPositionWindowMultiWindow: (x, y) = (%d, %d)\n",
x, y);
-#endif
/* Bail out if the Windows window handle is bad */
if (!hWnd)
{
-#if CYGWINDOWING_DEBUG
- ErrorF ("\timmediately return since hWnd is NULL\n");
-#endif
+ winDebug ("\timmediately return since hWnd is NULL\n");
return fResult;
}
@@ -211,7 +206,7 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
#if CYGMULTIWINDOW_DEBUG
lpRc = &rcNew;
- ErrorF ("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n",
+ winDebug ("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n",
GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
#endif
@@ -229,40 +224,45 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
GetClientRect (hWnd, &rcClient);
lpRc = &rcNew;
- ErrorF ("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
+ winDebug ("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
lpRc = &rcOld;
- ErrorF ("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
+ winDebug ("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
lpRc = &rcClient;
- ErrorF ("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
+ winDebug ("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
#endif
/* Check if the old rectangle and new rectangle are the same */
if (!EqualRect (&rcNew, &rcOld))
{
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winPositionWindowMultiWindow - Need to move\n");
-#endif
-
-#if CYGWINDOWING_DEBUG
- ErrorF ("\tMoveWindow to (%ld, %ld) - %ldx%ld\n", rcNew.left, rcNew.top,
+ winDebug ("winPositionWindowMultiWindow - Need to move\n");
+ winDebug ("\tMoveWindow to (%ld, %ld) - %ldx%ld\n", rcNew.left, rcNew.top,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
-#endif
- /* Change the position and dimensions of the Windows window */
- MoveWindow (hWnd,
- rcNew.left, rcNew.top,
- rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
- TRUE);
+
+ /* Change the position and dimensions of the Windows window */
+ if (pWinPriv->GlCtxWnd)
+ {
+ int iWidth=rcNew.right - rcNew.left;
+ int iHeight=rcNew.bottom - rcNew.top;
+ ScreenToClient(GetParent(hWnd), (LPPOINT)&rcNew);
+ MoveWindow (hWnd,
+ rcNew.left, rcNew.top,
+ iWidth, iHeight,
+ TRUE);
+ }
+ else
+ MoveWindow (hWnd,
+ rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ TRUE);
}
else
{
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winPositionWindowMultiWindow - Not need to move\n");
-#endif
+ winDebug ("winPositionWindowMultiWindow - Not need to move\n");
}
return fResult;
@@ -280,9 +280,7 @@ winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask)
ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin);
-#endif
+ winDebug ("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin);
WIN_UNWRAP(ChangeWindowAttributes);
fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask);
@@ -310,7 +308,7 @@ winUnmapWindowMultiWindow (WindowPtr pWin)
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winUnmapWindowMultiWindow - pWin: %08x\n", pWin);
+ winDebug ("winUnmapWindowMultiWindow - pWin: %08x\n", pWin);
#endif
WIN_UNWRAP(UnrealizeWindow);
@@ -341,7 +339,7 @@ winMapWindowMultiWindow (WindowPtr pWin)
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winMapWindowMultiWindow - pWin: %08x\n", pWin);
+ winDebug ("winMapWindowMultiWindow - pWin: %08x\n", pWin);
#endif
WIN_UNWRAP(RealizeWindow);
@@ -373,7 +371,7 @@ winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winReparentMultiWindow - pWin: %08x\n", pWin);
+ winDebug ("winReparentMultiWindow - pWin: %08x\n", pWin);
#endif
WIN_UNWRAP(ReparentWindow);
@@ -393,85 +391,22 @@ winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
void
winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
{
-#if 0
- WindowPtr pPrevWin;
- UINT uFlags;
- HWND hInsertAfter;
- HWND hWnd = NULL;
-#endif
ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
-#if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG
- winTrace ("winRestackMultiWindow - %08x\n", pWin);
-#endif
+ winDebug ("winRestackMultiWindow - %08x\n", pWin);
WIN_UNWRAP(RestackWindow);
if (pScreen->RestackWindow)
(*pScreen->RestackWindow)(pWin, pOldNextSib);
WIN_WRAP(RestackWindow, winRestackWindowMultiWindow);
-#if 1
/*
* Calling winReorderWindowsMultiWindow here means our window manager
* (i.e. Windows Explorer) has initiative to determine Z order.
*/
if (pWin->nextSib != pOldNextSib)
winReorderWindowsMultiWindow ();
-#else
- /* Bail out if no window privates or window handle is invalid */
- if (!pWinPriv || !pWinPriv->hWnd)
- return;
-
- /* Get a pointer to our previous sibling window */
- pPrevWin = pWin->prevSib;
-
- /*
- * Look for a sibling window with
- * valid privates and window handle
- */
- while (pPrevWin
- && !winGetWindowPriv(pPrevWin)
- && !winGetWindowPriv(pPrevWin)->hWnd)
- pPrevWin = pPrevWin->prevSib;
-
- /* Check if we found a valid sibling */
- if (pPrevWin)
- {
- /* Valid sibling - get handle to insert window after */
- hInsertAfter = winGetWindowPriv(pPrevWin)->hWnd;
- uFlags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE;
-
- hWnd = GetNextWindow (pWinPriv->hWnd, GW_HWNDPREV);
-
- do
- {
- if (GetProp (hWnd, WIN_WINDOW_PROP))
- {
- if (hWnd == winGetWindowPriv(pPrevWin)->hWnd)
- {
- uFlags |= SWP_NOZORDER;
- }
- break;
- }
- hWnd = GetNextWindow (hWnd, GW_HWNDPREV);
- }
- while (hWnd);
- }
- else
- {
- /* No valid sibling - make this window the top window */
- hInsertAfter = HWND_TOP;
- uFlags = SWP_NOMOVE | SWP_NOSIZE;
- }
-
- /* Perform the restacking operation in Windows */
- SetWindowPos (pWinPriv->hWnd,
- hInsertAfter,
- 0, 0,
- 0, 0,
- uFlags);
-#endif
}
@@ -493,12 +428,13 @@ winCreateWindowsWindow (WindowPtr pWin)
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
WinXSizeHints hints;
WindowPtr pDaddy;
+ DWORD dwStyle;
+ DWORD dwExStyle;
+ RECT rc;
winInitMultiWindowClass();
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
-#endif
+ winDebug ("winCreateWindowsWindow - pWin: %08x\n", pWin);
iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
@@ -506,12 +442,18 @@ winCreateWindowsWindow (WindowPtr pWin)
iWidth = pWin->drawable.width;
iHeight = pWin->drawable.height;
- /* ensure window actually ends up somewhere visible */
- if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))
- iX = CW_USEDEFAULT;
+ /* If it's an InputOutput window, and so is going to end up being made visible,
+ make sure the window actually ends up somewhere where it will be visible */
+ if (pWin->drawable.class != InputOnly)
+ {
+ if ((iX < GetSystemMetrics (SM_XVIRTUALSCREEN)) || (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN)))
+ iX = CW_USEDEFAULT;
+
+ if ((iY < GetSystemMetrics (SM_YVIRTUALSCREEN)) || (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN)))
+ iY = CW_USEDEFAULT;
+ }
- if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))
- iY = CW_USEDEFAULT;
+ winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
if (winMultiWindowGetTransientFor (pWin, &pDaddy))
{
@@ -537,10 +479,24 @@ winCreateWindowsWindow (WindowPtr pWin)
/* Create the window */
/* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
/* CW_USEDEFAULT, change back to popup after creation */
- hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
+
+ dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+ dwExStyle = WS_EX_TOOLWINDOW;
+ rc;
+ rc.top = 0;
+ rc.left = 0;
+ rc.bottom = iHeight;
+ rc.right = iWidth;
+ AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);
+ iHeight = rc.bottom - rc.top;
+ iWidth = rc.right - rc.left;
+
+ winDebug("winCreateWindowsWindow - window size %dx%d\n", iWidth, iHeight);
+
+ hWnd = CreateWindowExA (dwExStyle, /* Extended styles */
WINDOW_CLASS_X, /* Class name */
WINDOW_TITLE_X, /* Window name */
- WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+ dwStyle, /* Styles */
iX, /* Horizontal position */
iY, /* Vertical position */
iWidth, /* Right edge */
@@ -561,6 +517,10 @@ winCreateWindowsWindow (WindowPtr pWin)
if (hIcon) SendMessage (hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
+ /* If we asked the native WM to place the window, synchronize the X window position */
+ if ((iX == CW_USEDEFAULT) || (iY == CW_USEDEFAULT))
+ winAdjustXWindow(pWin, hWnd);
+
/* Change style back to popup, already placed... */
SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
SetWindowPos (hWnd, 0, 0, 0, 0, 0,
@@ -592,9 +552,11 @@ winDestroyWindowsWindow (WindowPtr pWin)
MSG msg;
winWindowPriv(pWin);
BOOL oldstate = winInDestroyWindowsWindow;
+ HICON hIcon;
+ HICON hIconSm;
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowsWindow\n");
+ winDebug ("winDestroyWindowsWindow\n");
#endif
/* Bail out if the Windows window handle is invalid */
@@ -603,6 +565,10 @@ winDestroyWindowsWindow (WindowPtr pWin)
winInDestroyWindowsWindow = TRUE;
+ /* Store the info we need to destroy after this window is gone */
+ hIcon = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_BIG, 0);
+ hIconSm = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0);
+
SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, NULL);
/* Destroy the Windows window */
DestroyWindow (pWinPriv->hWnd);
@@ -610,6 +576,10 @@ winDestroyWindowsWindow (WindowPtr pWin)
/* Null our handle to the Window so referencing it will cause an error */
pWinPriv->hWnd = NULL;
+ /* Destroy any icons we created for this window */
+ winDestroyIcon(hIcon);
+ winDestroyIcon(hIconSm);
+
/* Process all messages on our queue */
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
@@ -622,7 +592,7 @@ winDestroyWindowsWindow (WindowPtr pWin)
winInDestroyWindowsWindow = oldstate;
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("-winDestroyWindowsWindow\n");
+ winDebug ("-winDestroyWindowsWindow\n");
#endif
}
@@ -639,7 +609,7 @@ winUpdateWindowsWindow (WindowPtr pWin)
HWND hWnd = pWinPriv->hWnd;
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winUpdateWindowsWindow\n");
+ winDebug ("winUpdateWindowsWindow\n");
#endif
/* Check if the Windows window's parents have been destroyed */
@@ -655,20 +625,57 @@ winUpdateWindowsWindow (WindowPtr pWin)
}
/* Display the window without activating it */
- ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE);
+ if (pWin->drawable.class != InputOnly)
+ ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE);
/* Send first paint message */
UpdateWindow (pWinPriv->hWnd);
}
else if (hWnd != NULL)
{
- /* Destroy the Windows window if its parents are destroyed */
- winDestroyWindowsWindow (pWin);
- assert (pWinPriv->hWnd == NULL);
+ 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(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,pWin->drawable.x-offsetx,pWin->drawable.y-offsety,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_SHOWWINDOW);
+ }
+ else
+ {
+ /* Destroy the Windows window if its parents are destroyed */
+ /* First check if we need to release the DC when it is an opengl window */
+ winDestroyWindowsWindow (pWin);
+ assert (pWinPriv->hWnd == NULL);
+ }
}
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("-winUpdateWindowsWindow\n");
+ winDebug ("-winUpdateWindowsWindow\n");
#endif
}
@@ -687,7 +694,7 @@ winGetWindowID (WindowPtr pWin)
FindClientResourcesByType (c, RT_WINDOW, winFindWindow, &wi);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winGetWindowID - Window ID: %d\n", wi.id);
+ winDebug ("winGetWindowID - Window ID: %d\n", wi.id);
#endif
return wi.id;
@@ -725,17 +732,13 @@ winReorderWindowsMultiWindow (void)
DWORD dwCurrentProcessID = GetCurrentProcessId ();
DWORD dwWindowProcessID = 0;
-#if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG
- winTrace ("winReorderWindowsMultiWindow\n");
-#endif
+ winDebug ("winReorderWindowsMultiWindow\n");
if (fRestacking)
{
/* It is a recusive call so immediately exit */
-#if CYGWINDOWING_DEBUG
- ErrorF ("winReorderWindowsMultiWindow - "
+ winDebug ("winReorderWindowsMultiWindow - "
"exit because fRestacking == TRUE\n");
-#endif
return;
}
fRestacking = TRUE;
@@ -793,9 +796,7 @@ winMinimizeWindow (Window id)
winPrivScreenPtr pScreenPriv = NULL;
winScreenInfo *pScreenInfo = NULL;
-#if CYGWINDOWING_DEBUG
- ErrorF ("winMinimizeWindow\n");
-#endif
+ winDebug ("winMinimizeWindow\n");
dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, DixUnknownAccess);
if (!pWin)
@@ -837,9 +838,8 @@ winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt,
ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
-#if CYGWINDOWING_DEBUG
- ErrorF ("CopyWindowMultiWindow\n");
-#endif
+ winDebug ("CopyWindowMultiWindow\n");
+
WIN_UNWRAP(CopyWindow);
(*pScreen->CopyWindow)(pWin, oldpt, oldRegion);
WIN_WRAP(CopyWindow, winCopyWindowMultiWindow);
@@ -856,9 +856,7 @@ winMoveWindowMultiWindow (WindowPtr pWin, int x, int y,
ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
-#if CYGWINDOWING_DEBUG
- ErrorF ("MoveWindowMultiWindow to (%d, %d)\n", x, y);
-#endif
+ winDebug ("MoveWindowMultiWindow to (%d, %d)\n", x, y);
WIN_UNWRAP(MoveWindow);
(*pScreen->MoveWindow)(pWin, x, y, pSib, kind);
@@ -876,9 +874,8 @@ winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w,
ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
-#if CYGWINDOWING_DEBUG
- ErrorF ("ResizeWindowMultiWindow to (%d, %d) - %dx%d\n", x, y, w, h);
-#endif
+ winDebug ("ResizeWindowMultiWindow to (%d, %d) - %dx%d\n", x, y, w, h);
+
WIN_UNWRAP(ResizeWindow);
(*pScreen->ResizeWindow)(pWin, x, y, w, h, pSib);
WIN_WRAP(ResizeWindow, winResizeWindowMultiWindow);
@@ -908,15 +905,11 @@ winAdjustXWindow (WindowPtr pWin, HWND hwnd)
#define WIDTH(rc) (rc.right - rc.left)
#define HEIGHT(rc) (rc.bottom - rc.top)
-#if CYGWINDOWING_DEBUG
- ErrorF ("winAdjustXWindow\n");
-#endif
+ winDebug ("winAdjustXWindow\n");
if (IsIconic (hwnd))
{
-#if CYGWINDOWING_DEBUG
- ErrorF ("\timmediately return because the window is iconized\n");
-#endif
+ winDebug ("\timmediately return because the window is iconized\n");
/*
* If the Windows window is minimized, its WindowRect has
* meaningless values so we don't adjust X window to it.
@@ -932,34 +925,26 @@ winAdjustXWindow (WindowPtr pWin, HWND hwnd)
x = pDraw->x + GetSystemMetrics (SM_XVIRTUALSCREEN);
y = pDraw->y + GetSystemMetrics (SM_YVIRTUALSCREEN);
SetRect (&rcDraw, x, y, x + pDraw->width, y + pDraw->height);
-#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tDrawable extend {%d, %d, %d, %d}, {%d, %d}\n",
rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
-#endif
dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE);
dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE);
-#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tWindowStyle: %08x %08x\n", dwStyle, dwExStyle);
-#endif
AdjustWindowRectEx (&rcDraw, dwStyle, FALSE, dwExStyle);
/* The source of adjust */
GetWindowRect (hwnd, &rcWin);
-#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n",
rcWin.left, rcWin.top, rcWin.right, rcWin.bottom,
rcWin.right - rcWin.left, rcWin.bottom - rcWin.top);
winDebug("\tDraw extend {%d, %d, %d, %d}, {%d, %d}\n",
rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
-#endif
if (EqualRect (&rcDraw, &rcWin)) {
/* Bail if no adjust is needed */
-#if CYGWINDOWING_DEBUG
- ErrorF ("\treturn because already adjusted\n");
-#endif
+ winDebug ("\treturn because already adjusted\n");
return 0;
}
@@ -979,10 +964,8 @@ winAdjustXWindow (WindowPtr pWin, HWND hwnd)
vlist[1] = pDraw->y + dY - wBorderWidth(pWin);
vlist[2] = pDraw->width + dW;
vlist[3] = pDraw->height + dH;
-#if CYGWINDOWING_DEBUG
- ErrorF ("\tConfigureWindow to (%ld, %ld) - %ldx%ld\n", vlist[0], vlist[1],
+ winDebug ("\tConfigureWindow to (%ld, %ld) - %ldx%ld\n", vlist[0], vlist[1],
vlist[2], vlist[3]);
-#endif
return ConfigureWindow (pWin, CWX | CWY | CWWidth | CWHeight,
vlist, wClient(pWin));