From 45c62aae4b068c3dc4549f841f6089ca826b37a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 26 Feb 2018 16:03:16 +0100 Subject: Cocoa: Restore resizable window mask setting to 5.9 behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should be tied to the CustomizeWindowHint flag: if that flag is set we start out without NSResizableWindowMask and possibly add it later on if WindowMaximizeButtonHint is set. Change-Id: I7e826d4bd357a8a17c60cfef948af25d61b66ebf Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index f9c676a5b0..54254455e4 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -503,7 +503,7 @@ 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 = type != Qt::Dialog; // Dialogs: remove zoom button by disabling resize + const bool resizeable = !(flags & Qt::CustomizeWindowHint); // Remove zoom button by disabling resize // Select base window type. Note that the value of NSBorderlessWindowMask is 0. NSUInteger styleMask = (frameless || !resizeable) ? NSBorderlessWindowMask : NSResizableWindowMask; -- cgit v1.2.3 From 992f673782ac7b8edea0dc7b4498eb7f970b4ba8 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Wed, 21 Mar 2018 10:14:09 +0000 Subject: macOS: Handle NaN mouse event positions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When performing gestures such as Exposé or Mission Control with the mouse button down, the position of the mouse release event is returned with NaN values. This causes QGuiApplicationPrivate::processMouseEvent to be called recursively and ultimately crash. Task-number: QTBUG-67194 Change-Id: If1536bc4dc2075c498cdd6c5afe57c86bdaac13b Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 7b7b3f53d5..a88cd5feda 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -487,8 +487,12 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") NSPoint screenPoint; if (theEvent) { NSPoint windowPoint = [theEvent locationInWindow]; - NSRect screenRect = [[theEvent window] convertRectToScreen:NSMakeRect(windowPoint.x, windowPoint.y, 1, 1)]; - screenPoint = screenRect.origin; + if (qIsNaN(windowPoint.x) || qIsNaN(windowPoint.y)) { + screenPoint = [NSEvent mouseLocation]; + } else { + NSRect screenRect = [[theEvent window] convertRectToScreen:NSMakeRect(windowPoint.x, windowPoint.y, 1, 1)]; + screenPoint = screenRect.origin; + } } else { screenPoint = [NSEvent mouseLocation]; } -- cgit v1.2.3