Cocoa: Popups should not become key
... at least not like that.
We still need to find a way for the popup to receive and process key
events on its own, instead of depending on other layers inside Qt.
This would make Qt Quick control's PopupWindow implementation much
simpler, for example.
Revert "Cocoa: Allow popups to grab mouse and keyboard"
This reverts commit a25e6528d3
.
Task-number: QTBUG-35820
Task-number: QTBUG-35904
Change-Id: Ica10529308ab25938397c16b9c1e1ce6cbd8f247
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
4162ea3f50
commit
6cbbd1f93d
@ -211,7 +211,6 @@ public: // for QNSView
|
||||
QRect m_exposedGeometry;
|
||||
int m_registerTouchCount;
|
||||
bool m_resizableTransientParent;
|
||||
bool m_overrideBecomeKey;
|
||||
|
||||
static const int NoAlertRequest;
|
||||
NSInteger m_alertRequest;
|
||||
|
@ -160,9 +160,7 @@ static bool isMouseEvent(NSEvent *ev)
|
||||
|
||||
// Only tool or dialog windows should become key:
|
||||
if (m_cocoaPlatformWindow
|
||||
&& (m_cocoaPlatformWindow->m_overrideBecomeKey ||
|
||||
m_cocoaPlatformWindow->window()->type() == Qt::Tool ||
|
||||
m_cocoaPlatformWindow->window()->type() == Qt::Dialog))
|
||||
&& (m_cocoaPlatformWindow->window()->type() == Qt::Tool || m_cocoaPlatformWindow->window()->type() == Qt::Dialog))
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
@ -217,7 +215,6 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
|
||||
, m_isExposed(false)
|
||||
, m_registerTouchCount(0)
|
||||
, m_resizableTransientParent(false)
|
||||
, m_overrideBecomeKey(false)
|
||||
, m_alertRequest(NoAlertRequest)
|
||||
, monitor(nil)
|
||||
, m_drawContentBorderGradient(false)
|
||||
@ -705,8 +702,6 @@ bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
|
||||
if (!m_nsWindow)
|
||||
return false;
|
||||
|
||||
m_overrideBecomeKey = grab;
|
||||
|
||||
if (grab && ![m_nsWindow isKeyWindow])
|
||||
[m_nsWindow makeKeyWindow];
|
||||
else if (!grab && [m_nsWindow isKeyWindow])
|
||||
@ -719,8 +714,6 @@ bool QCocoaWindow::setMouseGrabEnabled(bool grab)
|
||||
if (!m_nsWindow)
|
||||
return false;
|
||||
|
||||
m_overrideBecomeKey = grab;
|
||||
|
||||
if (grab && ![m_nsWindow isKeyWindow])
|
||||
[m_nsWindow makeKeyWindow];
|
||||
else if (!grab && [m_nsWindow isKeyWindow])
|
||||
|
Loading…
Reference in New Issue
Block a user