hw/xwin: Remove winIsInternalWMRunning(), which now always returns FALSE

Also remove then unused variables and IsRaiseonClick()

v2:
Also remove unused pScreenInfo variable in winMWEXtWMRestackFrame()

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon Turney 2015-11-02 20:34:09 +00:00
parent 2779a28a86
commit 8407d30962
4 changed files with 5 additions and 292 deletions

View File

@ -1136,9 +1136,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
wBOOL CALLBACK winMWExtWMDecorateWindow(HWND hwnd, LPARAM lParam);
Bool
winIsInternalWMRunning(winScreenInfoPtr pScreenInfo);
void
winMWExtWMRestackWindows(ScreenPtr pScreen);
#endif

View File

@ -516,12 +516,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid;
winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen);
winScreenInfo *pScreenInfo = NULL;
DWORD dwCurrentProcessID = GetCurrentProcessId();
DWORD dwWindowProcessID = 0;
HWND hWnd;
Bool fFirst = TRUE;
Bool fNeedRestack = TRUE;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMRestackFrame (%p)\n", pRLWinPriv);
@ -530,9 +524,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
if (pScreenPriv && pScreenPriv->fRestacking)
return;
if (pScreenPriv)
pScreenInfo = pScreenPriv->pScreenInfo;
pRLWinPriv->fRestackingNow = TRUE;
/* Show window */
@ -547,62 +538,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
SetWindowPos(pRLWinPriv->hWnd, HWND_TOP,
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
else if (winIsInternalWMRunning(pScreenInfo)) {
/* using mulwinidow wm */
#if CYGMULTIWINDOW_DEBUG
winDebug("Win %p is not top\n", pRLWinPriv);
#endif
for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDPREV);
fNeedRestack && hWnd != NULL;
hWnd = GetNextWindow(hWnd, GW_HWNDPREV)) {
GetWindowThreadProcessId(hWnd, &dwWindowProcessID);
if ((dwWindowProcessID == dwCurrentProcessID)
&& GetProp(hWnd, WIN_WINDOW_PROP)) {
if (hWnd == pRLNextWinPriv->hWnd) {
/* Enable interleave X window and Windows window */
if (!fFirst) {
#if CYGMULTIWINDOW_DEBUG
winDebug("raise: Insert after Win %p\n",
pRLNextWinPriv);
#endif
SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
else {
#if CYGMULTIWINDOW_DEBUG
winDebug("No change\n");
#endif
}
fNeedRestack = FALSE;
break;
}
if (fFirst)
fFirst = FALSE;
}
}
for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDNEXT);
fNeedRestack && hWnd != NULL;
hWnd = GetNextWindow(hWnd, GW_HWNDNEXT)) {
GetWindowThreadProcessId(hWnd, &dwWindowProcessID);
if ((dwWindowProcessID == dwCurrentProcessID)
&& GetProp(hWnd, WIN_WINDOW_PROP)) {
if (hWnd == pRLNextWinPriv->hWnd) {
#if CYGMULTIWINDOW_DEBUG
winDebug("lower: Insert after Win %p\n", pRLNextWinPriv);
#endif
SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
fNeedRestack = FALSE;
break;
}
}
}
}
else {
/* using general wm like twm, wmaker etc.
Interleave X window and Windows window will cause problem. */

View File

@ -194,10 +194,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
/* Get current window placement */
GetWindowPlacement(pRLWinPriv->hWnd, &wndPlace);
if (winIsInternalWMRunning(pScreenInfo)) {
if (!pRLWinPriv->pFrame->win->overrideRedirect)
fDecorate = TRUE;
}
#if 0
if (wndPlace.showCmd == SW_HIDE)
return; //showCmd = SWP_HIDEWINDOW;
@ -344,15 +340,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
}
}
/*
* winIsInternalWMRunning (winScreenInfoPtr pScreenInfo)
*/
Bool
winIsInternalWMRunning(winScreenInfoPtr pScreenInfo)
{
return FALSE;
}
/*
* winMWExtWMRestackWindows
*/

View File

@ -60,9 +60,9 @@ static UINT_PTR g_uipMousePollingTimerID = 0;
* Local function
*/
DEFINE_ATOM_HELPER(AtmWindowsWmRaiseOnClick, WINDOWSWM_RAISE_ON_CLICK)
DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE)
DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE)
/* DEFINE_ATOM_HELPER(AtmWindowsWMClientWindow, WINDOWSWM_CLIENT_WINDOW) */
/*
* ConstrainSize - Taken from TWM sources - Respects hints for sizing
*/
@ -271,55 +271,6 @@ ValidateSizing(HWND hwnd, WindowPtr pWin, WPARAM wParam, LPARAM lParam)
return TRUE;
}
/*
* IsRaiseOnClick
*/
static Bool
IsRaiseOnClick(WindowPtr pWin)
{
struct _Window *pwin;
struct _Property *prop;
/* XXX We're getting inputInfo.poniter here, but this might be really wrong.
* Which pointer's current window do we want? */
WindowPtr pRoot = GetCurrentRootWindow(inputInfo.pointer);
if (!pWin) {
ErrorF("IsRaiseOnClick - no prop use default value:%d\n",
RAISE_ON_CLICK_DEFAULT);
return RAISE_ON_CLICK_DEFAULT;
}
pwin = (struct _Window *) pWin;
if (pwin->optional)
prop = (struct _Property *) pwin->optional->userProps;
else
prop = NULL;
while (prop) {
if (prop->propertyName == AtmWindowsWmRaiseOnClick()
&& prop->type == XA_INTEGER && prop->format == 32) {
return *(int *) prop->data;
}
else
prop = prop->next;
}
if (pWin != pRoot) {
return IsRaiseOnClick(pRoot);
}
else {
#if CYGMULTIWINDOW_DEBUG
winDebug("IsRaiseOnClick - no prop use default value:%d\n",
RAISE_ON_CLICK_DEFAULT);
#endif
return RAISE_ON_CLICK_DEFAULT;
}
}
/*
* IsMouseActive
*/
@ -388,8 +339,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
PAINTSTRUCT ps;
LPWINDOWPOS pWinPos = NULL;
RECT rcClient;
winWMMessageRec wmMsg;
Bool fWMMsgInitialized = FALSE;
/* Check if the Windows window property for our X window pointer is valid */
if ((pRLWinPriv =
@ -403,16 +352,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (pScreenPriv)
hwndScreen = pScreenPriv->hwndScreen;
wmMsg.msg = 0;
wmMsg.hwndWindow = hwnd;
wmMsg.iWindow = (Window) pWin->drawable.id;
wmMsg.iX = pRLWinPriv->pFrame->x;
wmMsg.iY = pRLWinPriv->pFrame->y;
wmMsg.iWidth = pRLWinPriv->pFrame->width;
wmMsg.iHeight = pRLWinPriv->pFrame->height;
fWMMsgInitialized = TRUE;
#if CYGDEBUG
winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam,
lParam);
@ -446,12 +385,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
DestroyWindow(hwnd);
}
else {
if (winIsInternalWMRunning(pScreenInfo)) {
/* Tell our Window Manager thread to kill the window */
wmMsg.msg = WM_WM_KILL;
if (fWMMsgInitialized)
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
}
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@ -680,19 +613,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n");
#endif
#if 1
/* Check if this window needs to be made active when clicked */
if (winIsInternalWMRunning(pScreenInfo) && pWin->overrideRedirect) {
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE - "
"MA_NOACTIVATE\n");
#endif
/* */
return MA_NOACTIVATE;
}
#endif
if (!winIsInternalWMRunning(pScreenInfo) && !IsMouseActive(pWin))
if (!IsMouseActive(pWin))
return MA_NOACTIVATE;
break;
@ -805,19 +726,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
winDebug("winMWExtWMWindowProc - WM_ACTIVATE\n");
#endif
if (LOWORD(wParam) != WA_INACTIVE) {
if (winIsInternalWMRunning(pScreenInfo)) {
#if 0
/* Raise the window to the top in Z order */
wmMsg.msg = WM_WM_RAISE;
if (fWMMsgInitialized)
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
#endif
/* Tell our Window Manager thread to activate the window */
wmMsg.msg = WM_WM_ACTIVATE;
if (fWMMsgInitialized)
if (!pWin || !pWin->overrideRedirect) /* for OOo menus */
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
}
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@ -838,14 +746,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
}
if (winIsInternalWMRunning(pScreenInfo) || IsRaiseOnClick(pWin)) {
#if CYGMULTIWINDOW_DEBUG
winDebug("Win %p has WINDOWSWM_RAISE_ON_CLICK.\n",
pRLWinPriv);
#endif
break;
}
#if CYGMULTIWINDOW_DEBUG
winDebug("Win %p forbid to change z order (%p).\n",
pRLWinPriv,
@ -889,9 +789,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
(short) HIWORD(lParam));
#endif
if (!pRLWinPriv->fMovingOrSizing) {
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow(pWin, hwnd);
winMWExtWMMoveXWindow(pWin, (LOWORD(lParam) - wBorderWidth(pWin)
- GetSystemMetrics(SM_XVIRTUALSCREEN)),
(HIWORD(lParam) - wBorderWidth(pWin)
@ -909,26 +806,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
winMWExtWMUpdateWindowDecoration(pRLWinPriv, pScreenInfo);
if (winIsInternalWMRunning(pScreenInfo)) {
#if CYGMULTIWINDOW_DEBUG || TRUE
winDebug("\tMapWindow\n");
#endif
/* Tell X to map the window */
MapWindow(pWin, wClient(pWin));
if (!pRLWinPriv->pFrame->win->overrideRedirect)
/* Bring the Windows window to the foreground */
SetForegroundWindow(hwnd);
/* Setup the Window Manager message */
wmMsg.msg = WM_WM_MAP;
wmMsg.iWidth = pRLWinPriv->pFrame->width;
wmMsg.iHeight = pRLWinPriv->pFrame->height;
/* Tell our Window Manager thread to map the window */
if (fWMMsgInitialized)
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
}
break;
case WM_SIZING:
@ -964,72 +841,12 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (pWinPos->flags & SWP_HIDEWINDOW)
break;
/* Reorder if window z order was changed */
if ((pScreenPriv != NULL)
&& !(pWinPos->flags & SWP_NOZORDER)
&& !(pWinPos->flags & SWP_SHOWWINDOW)
&& winIsInternalWMRunning(pScreenInfo)) {
#if CYGMULTIWINDOW_DEBUG
winDebug("\twindow z order was changed\n");
#endif
if (pWinPos->hwndInsertAfter == HWND_TOP
|| pWinPos->hwndInsertAfter == HWND_TOPMOST
|| pWinPos->hwndInsertAfter == HWND_NOTOPMOST) {
#if CYGMULTIWINDOW_DEBUG
winDebug("\traise to top\n");
#endif
/* Raise the window to the top in Z order */
wmMsg.msg = WM_WM_RAISE;
if (fWMMsgInitialized)
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
}
#if 1
else if (pWinPos->hwndInsertAfter == HWND_BOTTOM) {
}
else {
/* Check if this window is top of X windows. */
HWND hWndAbove = NULL;
DWORD dwCurrentProcessID = GetCurrentProcessId();
DWORD dwWindowProcessID = 0;
for (hWndAbove = pWinPos->hwndInsertAfter;
hWndAbove != NULL;
hWndAbove = GetNextWindow(hWndAbove, GW_HWNDPREV)) {
/* Ignore other XWin process's window */
GetWindowThreadProcessId(hWndAbove, &dwWindowProcessID);
if ((dwWindowProcessID == dwCurrentProcessID)
&& GetProp(hWndAbove, WIN_WINDOW_PROP)
&& !IsWindowVisible(hWndAbove)
&& !IsIconic(hWndAbove)) /* ignore minimized windows */
break;
}
/* If this is top of X windows in Windows stack,
raise it in X stack. */
if (hWndAbove == NULL) {
#if CYGMULTIWINDOW_DEBUG
winDebug("\traise to top\n");
#endif
/* Raise the window to the top in Z order */
wmMsg.msg = WM_WM_RAISE;
if (fWMMsgInitialized)
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
}
}
#endif
}
if (!(pWinPos->flags & SWP_NOSIZE)) {
if (IsIconic(hwnd)) {
#if CYGMULTIWINDOW_DEBUG
winDebug("\tIconic -> MINIMIZED\n");
#endif
if (winIsInternalWMRunning(pScreenInfo)) {
/* Raise the window to the top in Z order */
wmMsg.msg = WM_WM_LOWER;
if (fWMMsgInitialized)
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
}
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@ -1069,8 +886,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#if CYGMULTIWINDOW_DEBUG
winDebug("\tmove & resize\n");
#endif
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow(pWin, hwnd);
winMWExtWMMoveResizeXWindow(pWin,
rcClient.left -
@ -1092,8 +907,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#if CYGMULTIWINDOW_DEBUG
winDebug("\tmove\n");
#endif
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow(pWin, hwnd);
winMWExtWMMoveResizeXWindow(pWin,
rcClient.left -
@ -1115,8 +928,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#if CYGMULTIWINDOW_DEBUG
winDebug("\tmove\n");
#endif
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow(pWin, hwnd);
winMWExtWMMoveXWindow(pWin,
rcClient.left - wBorderWidth(pWin)
@ -1129,8 +940,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#if CYGMULTIWINDOW_DEBUG
winDebug("\tresize\n");
#endif
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow(pWin, hwnd);
winMWExtWMResizeXWindow(pWin,
rcClient.right - rcClient.left
@ -1165,12 +974,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#if CYGMULTIWINDOW_DEBUG
winDebug("\tSIZE_MINIMIZED\n");
#endif
if (winIsInternalWMRunning(pScreenInfo)) {
/* Raise the window to the top in Z order */
wmMsg.msg = WM_WM_LOWER;
if (fWMMsgInitialized)
winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
}
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@ -1206,9 +1010,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Perform the resize and notify the X client */
if (!pRLWinPriv->fMovingOrSizing) {
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow(pWin, hwnd);
winMWExtWMResizeXWindow(pWin, (short) LOWORD(lParam)
- wBorderWidth(pWin) * 2,
(short) HIWORD(lParam)
@ -1221,10 +1022,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP\n");
#endif
if (wParam) {
if (winIsInternalWMRunning(pScreenInfo)) {
}
else {
}
winWindowsWMSendEvent(WindowsWMActivationNotify,
WindowsWMActivationNotifyMask,
1,
@ -1265,9 +1062,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2);
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow(pWin, hwnd);
winMWExtWMMoveResizeXWindow(pWin, rcClient.left - wBorderWidth(pWin)
- GetSystemMetrics(SM_XVIRTUALSCREEN),
rcClient.top - wBorderWidth(pWin)