summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_qpa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication_qpa.cpp')
-rw-r--r--src/gui/kernel/qapplication_qpa.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp
index aed539e6d1..011d81bcde 100644
--- a/src/gui/kernel/qapplication_qpa.cpp
+++ b/src/gui/kernel/qapplication_qpa.cpp
@@ -137,6 +137,10 @@ void QApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate
case QWindowSystemInterfacePrivate::LocaleChange:
QApplicationPrivate::reportLocaleChange();
break;
+ case QWindowSystemInterfacePrivate::PlatformPanel:
+ QApplicationPrivate::processPlatformPanelEvent(
+ static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e));
+ break;
default:
qWarning() << "Unknown user input event type:" << e->type;
break;
@@ -185,6 +189,7 @@ static bool qt_try_modal(QWidget *widget, QEvent::Type type)
case QEvent::MouseMove:
case QEvent::KeyPress:
case QEvent::KeyRelease:
+ case QEvent::PlatformPanel:
block_event = true;
break;
default:
@@ -777,6 +782,19 @@ void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mouse
#endif // QT_NO_CONTEXTMENU
}
+void QApplicationPrivate::processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e)
+{
+ if (!e->widget)
+ return;
+
+ if (app_do_modal && !qt_try_modal(e->widget.data(), QEvent::PlatformPanel)) {
+ // a modal window is blocking this window, don't allow events through
+ return;
+ }
+
+ QEvent ev(QEvent::PlatformPanel);
+ QApplication::sendSpontaneousEvent(e->widget.data(), &ev);
+}
//### there's a lot of duplicated logic here -- refactoring required!