summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qcoreevent.cpp1
-rw-r--r--src/corelib/kernel/qcoreevent.h2
-rw-r--r--src/gui/kernel/qguiapplication.cpp18
-rw-r--r--src/gui/kernel/qguiapplication_p.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp7
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h1
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h10
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp11
8 files changed, 48 insertions, 4 deletions
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 8c4fa0155d..231e7f34cd 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -187,6 +187,7 @@ QT_BEGIN_NAMESPACE
\value PaletteChange Palette of the widget changed.
\value ParentAboutToChange The widget parent is about to change.
\value ParentChange The widget parent has changed.
+ \value PlatformPanel A platform specific panel has been requested.
\value Polish The widget is polished.
\value PolishRequest The widget should be polished.
\value QueryWhatsThis The widget should accept the event if it has "What's This?" help.
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 72733b3ffe..98dde37e3a 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -277,6 +277,8 @@ public:
SockClose = 211, // socket closed
+ PlatformPanel = 212,
+
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 46e7334e37..7e7997d7eb 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1203,6 +1203,10 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
QGuiApplicationPrivate::processTabletLeaveProximityEvent(
static_cast<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *>(e));
break;
+ case QWindowSystemInterfacePrivate::PlatformPanel:
+ QGuiApplicationPrivate::processPlatformPanelEvent(
+ static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e));
+ break;
default:
qWarning() << "Unknown user input event type:" << e->type;
break;
@@ -1617,6 +1621,20 @@ void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInter
#endif
}
+void QGuiApplicationPrivate::processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e)
+{
+ if (!e->window)
+ return;
+
+ if (e->window->d_func()->blockedByModalWindow) {
+ // a modal window is blocking this window, don't allow events through
+ return;
+ }
+
+ QEvent ev(QEvent::PlatformPanel);
+ QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);
+}
+
Q_GUI_EXPORT uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k)
{
return qHash(k.device) + k.touchPointId;
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index be5435c0bc..0c81d78f86 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -137,6 +137,8 @@ public:
static void processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e);
static void processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e);
+ static void processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e);
+
#ifndef QT_NO_DRAGANDDROP
static QPlatformDragQtResponse processDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions);
static QPlatformDropQtResponse processDrop(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions);
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index e74a7464b1..5ae55d6307 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -604,6 +604,13 @@ void QWindowSystemInterface::handleTabletLeaveProximityEvent(int device, int poi
handleTabletLeaveProximityEvent(time, device, pointerType, uid);
}
+void QWindowSystemInterface::handlePlatformPanelEvent(QWindow *w)
+{
+ QWindowSystemInterfacePrivate::PlatformPanelEvent *e =
+ new QWindowSystemInterfacePrivate::PlatformPanelEvent(w);
+ QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
+}
+
Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier) {
QWindowSystemInterface::handleMouseEvent(w, local, global, b, mods);
}
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index d3fc4734fe..fb856004b4 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -176,6 +176,7 @@ public:
static void handleTabletLeaveProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid);
static void handleTabletLeaveProximityEvent(int device, int pointerType, qint64 uid);
+ static void handlePlatformPanelEvent(QWindow *w);
// For event dispatcher implementations
static bool sendWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index b99ac71bb3..87dbeb2a9c 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -76,7 +76,8 @@ public:
FileOpen,
Tablet,
TabletEnterProximity,
- TabletLeaveProximity
+ TabletLeaveProximity,
+ PlatformPanel
};
class WindowSystemEvent {
@@ -325,6 +326,13 @@ public:
qint64 uid;
};
+ class PlatformPanelEvent : public WindowSystemEvent {
+ public:
+ explicit PlatformPanelEvent(QWindow *w)
+ : WindowSystemEvent(PlatformPanel), window(w) { }
+ QPointer<QWindow> window;
+ };
+
class WindowSystemEventList {
QList<WindowSystemEvent *> impl;
mutable QMutex mutex;
diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
index b42751676c..19fa9c5a9f 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
@@ -75,11 +75,16 @@ void QQnxNavigatorEventHandler::handleOrientationChange(int angle)
void QQnxNavigatorEventHandler::handleSwipeDown()
{
- // simulate menu key press
qNavigatorEventHandlerDebug() << Q_FUNC_INFO;
QWindow *w = QGuiApplication::focusWindow();
- QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyPress, Qt::Key_Menu, Qt::NoModifier);
- QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyRelease, Qt::Key_Menu, Qt::NoModifier);
+
+ if (w) {
+ // Get the top level window that is ancestor of the focus window
+ while (QWindow *parent = w->parent())
+ w = parent;
+
+ QWindowSystemInterface::handlePlatformPanelEvent(w);
+ }
}
void QQnxNavigatorEventHandler::handleExit()