summaryrefslogtreecommitdiff
path: root/hw/xwin/winmultiwindowwndproc.c
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2015-05-21 16:02:51 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2015-11-11 11:56:18 +0000
commit9c63d4c0b0c34100ab1eb63d7c682260a866e1db (patch)
tree7615c946e978e6a4cfb129dd7c0079e7058d45fe /hw/xwin/winmultiwindowwndproc.c
parent2c5379358a9dd619cb9aaf8bf887382f2264ef19 (diff)
Track the window state in multiwindow mode.
Track the window state (hidden, mimimized, shown, maximized) when changed by WM_CHANGE_STATE or via the native frame.
Diffstat (limited to 'hw/xwin/winmultiwindowwndproc.c')
-rw-r--r--hw/xwin/winmultiwindowwndproc.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 165fb736f..56aa5d8ba 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -295,6 +295,31 @@ winStartMousePolling(winPrivScreenPtr s_pScreenPriv)
MOUSE_POLLING_INTERVAL, NULL);
}
+static
+void
+winAdjustXWindowState(winPrivScreenPtr s_pScreenPriv, winWMMessageRec *wmMsg)
+{
+ wmMsg->msg = WM_WM_CHANGE_STATE;
+ if (IsIconic(wmMsg->hwndWindow)) {
+ wmMsg->dwID = 3; // IconicState
+ winSendMessageToWM(s_pScreenPriv->pWMInfo, wmMsg);
+ }
+ else if (IsZoomed(wmMsg->hwndWindow)) {
+ wmMsg->dwID = 2; // ZoomState
+ winSendMessageToWM(s_pScreenPriv->pWMInfo, wmMsg);
+ }
+ else if (IsWindowVisible(wmMsg->hwndWindow)) {
+ wmMsg->dwID = 1; // NormalState
+ winSendMessageToWM(s_pScreenPriv->pWMInfo, wmMsg);
+ }
+ else {
+ /* Only the client, not the user can Withdraw windows, so it doesn't make
+ much sense to handle that state here, and anything else is an
+ unanticapted state. */
+ ErrorF("winAdjustXWindowState - Unknown state for %p\n", wmMsg->hwndWindow);
+ }
+}
+
/*
* winTopLevelWindowProc - Window procedure for all top-level Windows windows.
*/
@@ -869,6 +894,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
RemoveProp(hwnd, WIN_WINDOW_PROP);
RemoveProp(hwnd, WIN_WID_PROP);
RemoveProp(hwnd, WIN_NEEDMANAGE_PROP);
+ RemoveProp(hwnd, WIN_STATE_PROP);
break;
@@ -1017,6 +1043,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Adjust the X Window to the moved Windows window */
hasEnteredSizeMove = FALSE;
winAdjustXWindow(pWin, hwnd);
+ if (fWMMsgInitialized)
+ winAdjustXWindowState(s_pScreenPriv, &wmMsg);
return 0;
case WM_SIZE:
@@ -1045,6 +1073,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (!hasEnteredSizeMove) {
/* Adjust the X Window to the moved Windows window */
winAdjustXWindow(pWin, hwnd);
+ if (fWMMsgInitialized)
+ winAdjustXWindowState(s_pScreenPriv, &wmMsg);
if (wParam == SIZE_MINIMIZED)
winReorderWindowsMultiWindow();
}