summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2015-07-01 16:30:36 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2016-04-07 10:31:13 +0100
commit8114b8127f01fc81390fc13e3d09bcc50e41a66f (patch)
treee3fba376ef3ba2937b8f3c4dd688b0ed6e0b2f7d
parent6a64b9d7af70dc7ff2cac8b35a1f7b0797823733 (diff)
hw/xwin: In multiwindow mode, do window minimization entirely in the WM
Remove winMinimizeWindow(), implement as UpdateState() in the WM instead, which uses getHwnd() to map a Window XID to a HWND (like everything else in the WM), rather than peering into the servers internal data structures. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r--hw/xwin/winmultiwindowwindow.c38
-rw-r--r--hw/xwin/winmultiwindowwm.c22
-rw-r--r--hw/xwin/winwindow.h3
3 files changed, 20 insertions, 43 deletions
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index e82d91591..4ec5634af 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -800,44 +800,6 @@ winReorderWindowsMultiWindow(void)
}
/*
- * winMinimizeWindow - Minimize in response to WM_CHANGE_STATE
- */
-
-void
-winMinimizeWindow(Window id)
-{
- WindowPtr pWin;
- winPrivWinPtr pWinPriv;
-
- HWND hWnd;
- ScreenPtr pScreen = NULL;
- winPrivScreenPtr pScreenPriv = NULL;
-
-#if CYGWINDOWING_DEBUG
- ErrorF("winMinimizeWindow\n");
-#endif
-
- dixLookupResourceByType((void *) &pWin, id, RT_WINDOW, NullClient,
- DixUnknownAccess);
- if (!pWin) {
- ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__);
- return;
- }
-
- pScreen = pWin->drawable.pScreen;
- if (pScreen)
- pScreenPriv = winGetScreenPriv(pScreen);
-
- if (pScreenPriv)
- {
- pWinPriv = winGetWindowPriv(pWin);
- hWnd = pWinPriv->hWnd;
- }
-
- ShowWindow(hWnd, SW_MINIMIZE);
-}
-
-/*
* CopyWindow - See Porting Layer Definition - p. 39
*/
void
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index e594794c1..80bb483cb 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -672,6 +672,25 @@ UpdateStyle(WMInfoPtr pWMInfo, Window iWindow)
WS_EX_APPWINDOW) ? TRUE : FALSE);
}
+/*
+ * Updates the state of a HWND
+ * (only minimization supported at the moment)
+ */
+
+static void
+UpdateState(WMInfoPtr pWMInfo, Window iWindow)
+{
+ HWND hWnd;
+
+ winDebug("UpdateState: iWindow 0x%08x\n", (int)iWindow);
+
+ hWnd = getHwnd(pWMInfo, iWindow);
+ if (!hWnd)
+ return;
+
+ ShowWindow(hWnd, SW_MINIMIZE);
+}
+
#if 0
/*
* Fix up any differences between the X11 and Win32 window stacks
@@ -879,8 +898,7 @@ winMultiWindowWMProc(void *pArg)
break;
case WM_WM_CHANGE_STATE:
- /* Minimize the window in Windows */
- winMinimizeWindow(pNode->msg.iWindow);
+ UpdateState(pWMInfo, pNode->msg.iWindow);
break;
default:
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index 5a1759d1e..e07b6a867 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -145,9 +145,6 @@ void
winDeinitMultiWindowWM(void);
void
- winMinimizeWindow(Window id);
-
-void
winPropertyStoreInit(void);
void