summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview.h
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-10-22 18:36:24 +0200
committerGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-10-23 11:28:49 +0000
commitb50ee28eb52fa23c05a9599e02e9671f7ab42d10 (patch)
treebc72a3331fcc19ef2b2baf5cd2e9a5f6648f5904 /src/plugins/platforms/cocoa/qnsview.h
parent07475c662eb73c833da2d461b8ef2702ca1e2cfb (diff)
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 <timur.pocheptsov@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.h')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
1 files changed, 1 insertions, 0 deletions
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;