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>
bb10
Morten Johan Sørvig 2018-06-20 00:30:17 +02:00
parent cd08753d3e
commit ca1ad3b7cb
1 changed files with 4 additions and 1 deletions

View File

@ -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;