From 8114b8127f01fc81390fc13e3d09bcc50e41a66f Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 1 Jul 2015 16:30:36 +0100 Subject: 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 Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwm.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'hw/xwin/winmultiwindowwm.c') 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: -- cgit v1.2.3