path: root/src/plugins/platforms/cocoa/qnswindowdelegate.h
diff options
authorTor Arne Vestbø <>2017-02-06 15:28:23 +0100
committerTor Arne Vestbø <>2017-02-16 14:32:00 +0000
commitef32f16fc284e5017da6016f72a17957fa2fef34 (patch)
treed87fee6aec8e85d55d02730fe117289af4c65a6c /src/plugins/platforms/cocoa/qnswindowdelegate.h
parent925a3c65297edc37e394b9837782e79d837d20d1 (diff)
macOS: Rewrite window state handling
Instead of relying on specific notifications to change the window state we now evaluate the state based on the current window state. This allows us to get rid of windowShouldZoom in the window delegate, making window state handling work for foreign windows as well, and also allows us to re-evaluate the state in more places, such as when moving a window, which may bring it out of maximized state. The full screen state is tracked by a helper category that doesn't just rely on the styleFlag, but also on the full screen notifications. This is needed as macOS will complain if you try to go in or out of fullscreen while a transition is in effect. The differentiation between performFoo: and foo: has been removed, as the latter works in both cases and doesn't rely on the button being visible/enabled. These changes fixes many observed quirks in the window state handling that also resulted in making it hard to write tests that relied on the fullscreen/maximized operations always working. Change-Id: I0538c42d9223a56f20ec9156f4939288e0750552 Reviewed-by: Timur Pocheptsov <> Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnswindowdelegate.h')
1 files changed, 0 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h
index a465b249c5..d2078b5786 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.h
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h
@@ -52,7 +52,6 @@
- (id)initWithQCocoaWindow:(QCocoaWindow *)cocoaWindow;
- (BOOL)windowShouldClose:(NSNotification *)notification;
-- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu;
- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard;