diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2015-08-04 16:05:05 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-06-23 14:15:27 +0100 |
commit | 4b123e0f61eb55e59d30bf442499cf3b3f621c3b (patch) | |
tree | 6b96ce5ea6052b1385a1a797123f5371460dd35b /hw/xwin | |
parent | 504bf495f9b3adea1ba650469223511f81709714 (diff) |
hw/xwin: Make window maximizable if a maximium size larger than virtual desktop size is specified
Firefox 38 has a WM_NORMAL_HINTS with a maximum size of 32767x32767.
Don't remove the maximize control from the window frame if the maximum size
is bigger than the virtual desktop size, as maximizing the window will not
exceed the maximium size.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw/xwin')
-rw-r--r-- | hw/xwin/winmultiwindowwm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 580d641b7..df7e6d3d5 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1763,8 +1763,12 @@ winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle) cookie = xcb_icccm_get_wm_normal_hints(conn, iWindow); if (xcb_icccm_get_wm_normal_hints_reply(conn, cookie, &size_hints, NULL)) { if (size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) { - /* Not maximizable if a maximum size is specified */ - hint |= HINT_NOMAXIMIZE; + + /* Not maximizable if a maximum size is specified, and that size + is smaller (in either dimension) than the screen size */ + if ((size_hints.max_width < GetSystemMetrics(SM_CXVIRTUALSCREEN)) + || (size_hints.max_height < GetSystemMetrics(SM_CYVIRTUALSCREEN))) + hint |= HINT_NOMAXIMIZE; if (size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) { /* |