diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2015-06-28 18:13:42 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-11-17 13:15:44 +0000 |
commit | edf9e60fbe8079bfd71366b8358d5630170ecaba (patch) | |
tree | b9d641dc867c64dd45494f9904f8f546ff098d7f | |
parent | 32e1287c405dfebb4e42569f5927f287ef1e0a85 (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.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 93cf889c1..16d13ff36 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -189,7 +189,7 @@ static Bool CheckAnotherWindowManager(xcb_connection_t *conn, DWORD dwScreen); static void - winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle); + winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle, Bool onCreate); static void winApplyUrgency(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd); @@ -697,7 +697,7 @@ UpdateIcon(WMInfoPtr pWMInfo, xcb_window_t iWindow) */ static void -UpdateStyle(WMInfoPtr pWMInfo, xcb_window_t iWindow) +UpdateStyle(WMInfoPtr pWMInfo, xcb_window_t iWindow, Bool onCreate) { HWND hWnd; HWND zstyle = HWND_NOTOPMOST; @@ -708,7 +708,7 @@ UpdateStyle(WMInfoPtr pWMInfo, xcb_window_t 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 */ @@ -1007,7 +1007,7 @@ winMultiWindowWMProc(void *pArg) sizeof(HWND)/4, &(pNode->msg.hwndWindow)); UpdateName(pWMInfo, pNode->msg.iWindow); - UpdateStyle(pWMInfo, pNode->msg.iWindow); + UpdateStyle(pWMInfo, pNode->msg.iWindow, TRUE); UpdateIcon(pWMInfo, pNode->msg.iWindow); @@ -1094,7 +1094,7 @@ winMultiWindowWMProc(void *pArg) if (IsOverrideRedirect(pWMInfo->conn, pNode->msg.iWindow)) break; - UpdateStyle(pWMInfo, pNode->msg.iWindow); + UpdateStyle(pWMInfo, pNode->msg.iWindow, FALSE); } break; @@ -1891,7 +1891,7 @@ winApplyUrgency(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd) #define HINT_MIN (1L<<1) static void -winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle) +winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle, Bool onCreate) { xcb_connection_t *conn = pWMInfo->conn; @@ -2058,6 +2058,12 @@ winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle) style = STYLE_NONE; style = winOverrideStyle(res_name, res_class, 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); #define APPLICATION_ID_FORMAT "%s.xwin.%s" #define APPLICATION_ID_UNKNOWN "unknown" |