summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2015-06-28 18:13:42 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2015-11-03 17:16:15 +0000
commit9ff90411efb0ac444a4fbe8b7d8127840efbf0bb (patch)
treec8ba53b89cd2decc87e15537aae94fa939cb3c80
parentd9872a1fe8541f2d2713f480252147be0d7c1f55 (diff)
Only apply MINIMIZE/MAXIMIZE style from XWinrc when mapping the window
It only makes sense for winApplyStyle() to apply MINIMIZE or MAXIMIZE window states when the windows is initially shown, otherwise there is no way for the window to leave that state.
-rw-r--r--hw/xwin/winmultiwindowwm.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index d077ca1d2..956dbdb86 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -221,7 +221,7 @@ static void
winApplyUrgency(Display * pDisplay, Window iWindow, HWND hWnd);
static void
- winApplyHints(WMInfoPtr pWMInfo, Window iWindow, HWND hWnd, HWND * zstyle);
+ winApplyHints(WMInfoPtr pWMInfo, Window iWindow, HWND hWnd, HWND * zstyle, Bool onCreate);
/*
* Local globals
@@ -743,7 +743,7 @@ UpdateIcon(WMInfoPtr pWMInfo, Window iWindow)
*/
static void
-UpdateStyle(WMInfoPtr pWMInfo, Window iWindow)
+UpdateStyle(WMInfoPtr pWMInfo, Window iWindow, Bool onCreate)
{
HWND hWnd;
HWND zstyle = HWND_NOTOPMOST;
@@ -754,7 +754,7 @@ UpdateStyle(WMInfoPtr pWMInfo, Window iWindow)
return;
/* Determine the Window style, which determines borders and clipping region... */
- winApplyHints(pWMInfo, iWindow, hWnd, &zstyle);
+ winApplyHints(pWMInfo, iWindow, hWnd, &zstyle, onCreate);
winUpdateWindowPosition(hWnd, &zstyle);
/* Apply the updated window style, without changing it's show or activation state */
@@ -1053,7 +1053,7 @@ winMultiWindowWMProc(void *pArg)
PropModeReplace,
(unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
UpdateName(pWMInfo, pNode->msg.iWindow);
- UpdateStyle(pWMInfo, pNode->msg.iWindow);
+ UpdateStyle(pWMInfo, pNode->msg.iWindow, TRUE);
UpdateIcon(pWMInfo, pNode->msg.iWindow);
@@ -1142,7 +1142,7 @@ winMultiWindowWMProc(void *pArg)
if (attr.override_redirect)
break;
- UpdateStyle(pWMInfo, pNode->msg.iWindow);
+ UpdateStyle(pWMInfo, pNode->msg.iWindow, FALSE);
}
break;
@@ -1945,7 +1945,7 @@ winApplyUrgency(Display * pDisplay, Window iWindow, HWND hWnd)
#define HINT_MIN (1L<<1)
static void
-winApplyHints(WMInfoPtr pWMInfo, Window iWindow, HWND hWnd, HWND * zstyle)
+winApplyHints(WMInfoPtr pWMInfo, Window iWindow, HWND hWnd, HWND * zstyle, Bool onCreate)
{
static Atom motif_wm_hints, windowType;
static Atom fullscreenState, belowState, aboveState, skiptaskbarState;
@@ -2129,6 +2129,13 @@ winApplyHints(WMInfoPtr pWMInfo, Window iWindow, HWND hWnd, HWND * zstyle)
free(application_id);
if (window_name)
XFree(window_name);
+
+ /*
+ It only makes sense to apply minimize/maximize override when the
+ window is mapped, as otherwise the state can't be changed.
+ */
+ if (!onCreate)
+ style &= ~(STYLE_MAXIMIZE | STYLE_MINIMIZE);
}
else {
style = STYLE_NONE;