summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qdnd_x11.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2010-04-14 03:06:22 +0200
committerBradley T. Hughes <bradley.hughes@nokia.com>2010-04-17 22:34:51 +0200
commitc8e08e5c74fbdae8a60bdd9b08966ea7fc728845 (patch)
tree1cfeb48e2013d30fd2b272afddb9942b21e31961 /src/gui/kernel/qdnd_x11.cpp
parent9b77de3effdb2eb7d6df212ab9a8a19551ecb550 (diff)
Prevent accelerators from firing on X11 and QWS during a drag
Drag-and-drop has always been modal, and already blocks key events. It should block all application accelerators as well, to avoid unexpected things like being unable to cancel the drag-and-drop (as mentioned in the task), or by being able to unexpectedly recurse the drag-and-drop event loop (by, for example, opening a file dialog). Task-number: QTBUG-9786 Reviewed-by: TrustMe
Diffstat (limited to 'src/gui/kernel/qdnd_x11.cpp')
-rw-r--r--src/gui/kernel/qdnd_x11.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index 0a05d8e625..2b123170cd 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -1299,6 +1299,12 @@ bool QDragManager::eventFilter(QObject * o, QEvent * e)
return true;
}
+ if (e->type() == QEvent::ShortcutOverride) {
+ // prevent accelerators from firing while dragging
+ e->accept();
+ return true;
+ }
+
if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) {
QKeyEvent *ke = ((QKeyEvent*)e);
if (ke->key() == Qt::Key_Escape && e->type() == QEvent::KeyPress) {