From ca1ad3b7cbf6d2b20787661fac1dc48da2999a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 20 Jun 2018 00:30:17 +0200 Subject: Cocoa: Tool windows should always be resizable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/cocoa/qcocoawindow.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms') 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(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; -- cgit v1.2.3