0020-Synthesize-Enter-LeaveEvent-for-accepted-QTabletEven.patch 957 Bytes
Newer Older
Boudewijn Rempt's avatar
Boudewijn Rempt committed
1
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
Boudewijn Rempt's avatar
Boudewijn Rempt committed
2
index fbc71cd0e..729a7f701 100644
Boudewijn Rempt's avatar
Boudewijn Rempt committed
3 4
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
Boudewijn Rempt's avatar
Boudewijn Rempt committed
5
@@ -1051,6 +1051,18 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
         event->setAccepted(ev.isAccepted());
     }
 
+    /**
+     * Synthesize Enter/Leave events if it is requested by the system and user
+     */
+    if (widget != qt_last_mouse_receiver &&
+        event->isAccepted() &&
+        !QWindowSystemInterfacePrivate::TabletEvent::platformSynthesizesMouse &&
+        qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTabletEvents)) {
+
+        QApplicationPrivate::dispatchEnterLeave(widget, qt_last_mouse_receiver, event->globalPos());
+        qt_last_mouse_receiver = widget;
+    }
+
     if (event->type() == QEvent::TabletRelease && event->buttons() == Qt::NoButton)
         qt_tablet_target = 0;
 }