summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>2012-06-12 10:59:27 -0700
committerQt by Nokia <qt-info@nokia.com>2012-06-14 03:03:38 +0200
commit7020c2fe2a9891eeb661bcd42e8172cc80ff3bd8 (patch)
tree19c69c0d7950a49eb67de171042870580a4cffbb /src/gui/kernel
parent4618bc3ea0c84762683d99b07c5e56792d2bb0e7 (diff)
Deliver wheel events when window is null
The generic input plugins do not set the window parameter. So, use the same technique we use with mouse event handling to determine the window to deliver the event to. Done-with: Johannes Zellner Change-Id: I950c0ad2f330dccfdcc41b8d01f62cd39902bc9c Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qguiapplication.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 846b7d01bf..3cd8d5f800 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1255,26 +1255,26 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e)
{
- if (!e->window)
- return;
-
+ QWindow *window = e->window.data();
QPointF globalPoint = e->globalPos;
+
+ if (!window) {
+ window = QGuiApplication::topLevelAt(globalPoint.toPoint());
+ if (!window)
+ return;
+ }
+
QGuiApplicationPrivate::lastCursorPosition = globalPoint;
modifier_buttons = e->modifiers;
- QWindow *window = e->window.data();
-
- if (window) {
- if (window->d_func()->blockedByModalWindow) {
- // a modal window is blocking this window, don't allow wheel events through
- return;
- }
+ if (window->d_func()->blockedByModalWindow) {
+ // a modal window is blocking this window, don't allow wheel events through
+ return;
+ }
- QWheelEvent ev(e->localPos, e->globalPos, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers);
- ev.setTimestamp(e->timestamp);
- QGuiApplication::sendSpontaneousEvent(window, &ev);
- return;
- }
+ QWheelEvent ev(e->localPos, e->globalPos, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers);
+ ev.setTimestamp(e->timestamp);
+ QGuiApplication::sendSpontaneousEvent(window, &ev);
}
// Remember, Qt convention is: keyboard state is state *before*