diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-06-20 00:30:17 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-06-21 13:31:17 +0000 |
commit | ca1ad3b7cbf6d2b20787661fac1dc48da2999a3e (patch) | |
tree | 6bfb66e0c234ccb153abe59108b44d2b0787f80f /src | |
parent | cd08753d3e2ac02663ba0ab588d7d926f7438475 (diff) |
Cocoa: Tool windows should always be resizable
Undocked dock windows have the following flags:
Tool|X11BypassWindowManagerHint|WindowTitleHint|
WindowSystemMenuHint|CustomizeWindowHint|WindowCloseButtonHint
CustomizeWindowHint with no WindowMaximizeButtonHint
means that we disable window resize in order to remove
the zoom button (this is perhaps questionable, but
is established behavior). That will however break dock
windows: add exception for Qt::Tool.
After refactoring we discover this special case, again.
See previous fix in d37643c43.
Change-Id: I67a09341e75b92fdb3108ea93901295c39107fe1
History-repeats: QTBUG-46882
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 72f3bc0075..e350d7db51 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -505,7 +505,10 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags) { const Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask)); const bool frameless = (flags & Qt::FramelessWindowHint) || windowIsPopupType(type); - const bool resizeable = !(flags & Qt::CustomizeWindowHint); // Remove zoom button by disabling resize + + // Remove zoom button by disabling resize for CustomizeWindowHint windows, except for + // Qt::Tool windows (e.g. dock windows) which should always be resizeable. + const bool resizeable = !(flags & Qt::CustomizeWindowHint) || (type == Qt::Tool); // Select base window type. Note that the value of NSBorderlessWindowMask is 0. NSUInteger styleMask = (frameless || !resizeable) ? NSBorderlessWindowMask : NSResizableWindowMask; |