diff options
author | Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> | 2015-03-16 15:51:53 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-03-21 10:05:57 +0000 |
commit | e6b97fd2c793ae702cf2102e43ce9efb4d27983a (patch) | |
tree | 91a568c94d4b3b1964dcdd2a028aae0585a8e646 /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | aa2c5ba99528a08e6a6d02f5c7c64e93abd60b3e (diff) |
Cocoa: Don't let key events triggering input method events close dialog.
Added a flag to QCocoaWindow to ignore shouldCloseWindow. This is set
from within QNSView when escape is pressed and the current focus widgets
is processing input method events (like QTextEdit). This lead to
unwanted dialog rejects.
Task-number: QTBUG-44076
Change-Id: Ic90a8a6ba8c5cddbc0d486563acad57dd384d179
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 5877885eee..f811bd630f 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -371,6 +371,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) , m_synchedWindowState(Qt::WindowActive) , m_windowModality(Qt::NonModal) , m_windowUnderMouse(false) + , m_ignoreWindowShouldClose(false) , m_inConstructor(true) , m_inSetVisible(false) , m_inSetGeometry(false) @@ -1218,6 +1219,9 @@ void QCocoaWindow::windowDidEndLiveResize() bool QCocoaWindow::windowShouldClose() { + // might have been set from qnsview.mm + if (m_ignoreWindowShouldClose) + return false; bool accepted = false; QWindowSystemInterface::handleCloseEvent(window(), &accepted); QWindowSystemInterface::flushWindowSystemEvents(); |