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>
This commit is contained in:
parent
6a64b9d7af
commit
8114b8127f
|
@ -799,44 +799,6 @@ winReorderWindowsMultiWindow(void)
|
|||
fRestacking = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -144,9 +144,6 @@ winInitWM(void **ppWMInfo,
|
|||
void
|
||||
winDeinitMultiWindowWM(void);
|
||||
|
||||
void
|
||||
winMinimizeWindow(Window id);
|
||||
|
||||
void
|
||||
winPropertyStoreInit(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user