From b50ee28eb52fa23c05a9599e02e9671f7ab42d10 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 22 Oct 2015 18:36:24 +0200 Subject: QWidgetAction: Don't deactivate the current window on Mac We check the name of the window class the widget's QNSView changes window and set a flag when the that window is a native Cocoa menu window. Later, only those views not inside a native menu can become first responder, ensuring Qt won't deactivate the main window. We're allowed to reject becoming the first responder mainly because Cocoa itself doesn't support sending key event to menu views and, therefore, it doesn't change what's already possible. This patch also sets the widget action visible, which needs to be done right after reparenting it to the container widget. Besides that, it also contains a few small code cleaning changes related to Cocoa's support of QWidgetAction. Change-Id: Ia2170bdc5e1f40bfa2f1091c05e9e99397c47187 Task-number: QTBUG-44015 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qnsview.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/cocoa/qnsview.h') diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 028a34af1c..a2890d9b4a 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -77,6 +77,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); bool m_scrolling; bool m_exposedOnMoveToWindow; NSEvent *m_currentlyInterpretedKeyEvent; + bool m_isMenuView; } - (id)init; -- cgit v1.2.3 From 7df107f0266892276c85d259afba335c2a77ba07 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 22 Oct 2015 12:54:18 +0200 Subject: Cocoa: Implement QPlatformInputContext::locale(). Listen to NSTextInputContextKeyboardSelectionDidChangeNotification. Task-number: QTBUG-48772 Change-Id: Icea4ef61fd184edbe65a7f195318832a22c312ab Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/cocoa/qnsview.h') diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index a2890d9b4a..de28b8d74a 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -95,6 +95,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); - (void)notifyWindowStateChanged:(Qt::WindowState)newState; - (void)windowNotification : (NSNotification *) windowNotification; - (void)notifyWindowWillZoom:(BOOL)willZoom; +- (void)textInputContextKeyboardSelectionDidChangeNotification : (NSNotification *) textInputContextKeyboardSelectionDidChangeNotification; - (void)viewDidHide; - (void)viewDidUnhide; -- cgit v1.2.3