diff options
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qnswindow.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnswindow.mm | 22 |
2 files changed, 2 insertions, 24 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindow.h b/src/plugins/platforms/cocoa/qnswindow.h index c5f6403478..fc702058c5 100644 --- a/src/plugins/platforms/cocoa/qnswindow.h +++ b/src/plugins/platforms/cocoa/qnswindow.h @@ -77,14 +77,10 @@ typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow; { QCocoaNSWindow *_window; QPointer<QCocoaWindow> _platformWindow; - BOOL _grabbingMouse; - BOOL _releaseOnMouseUp; } @property (nonatomic, readonly) QCocoaNSWindow *window; @property (nonatomic, readonly) QCocoaWindow *platformWindow; -@property (nonatomic) BOOL grabbingMouse; -@property (nonatomic) BOOL releaseOnMouseUp; - (id)initWithNSWindow:(QCocoaNSWindow *)window platformWindow:(QCocoaWindow *)platformWindow; - (void)handleWindowEvent:(NSEvent *)theEvent; diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm index 7deca133b1..588a91b944 100644 --- a/src/plugins/platforms/cocoa/qnswindow.mm +++ b/src/plugins/platforms/cocoa/qnswindow.mm @@ -90,8 +90,6 @@ static bool isMouseEvent(NSEvent *ev) @implementation QNSWindowHelper @synthesize window = _window; -@synthesize grabbingMouse = _grabbingMouse; -@synthesize releaseOnMouseUp = _releaseOnMouseUp; - (QCocoaWindow *)platformWindow { @@ -118,17 +116,6 @@ static bool isMouseEvent(NSEvent *ev) - (void)handleWindowEvent:(NSEvent *)theEvent { - if (theEvent.type == NSLeftMouseDown) { - self.grabbingMouse = YES; - } else if (theEvent.type == NSLeftMouseUp) { - self.grabbingMouse = NO; - if (self.releaseOnMouseUp) { - [self detachFromPlatformWindow]; - [self.window release]; - return; - } - } - // The call to -[NSWindow sendEvent] may result in the window being deleted // (e.g., when closing the window by pressing the title bar close button). [self retain]; @@ -242,14 +229,9 @@ static const bool kNoDefer = NO; { qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self; + [self.helper detachFromPlatformWindow]; [self close]; - - if (self.helper.grabbingMouse) { - self.helper.releaseOnMouseUp = YES; - } else { - [self.helper detachFromPlatformWindow]; - [self release]; - } + [self release]; } - (void)dealloc |