summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuc Devallonne <luc.devallonne@mnemis.com>2009-07-10 14:22:33 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-07-10 14:22:33 (GMT)
commit4ed3ee42bae92b0feb5c898e4f0fdf7d34e34108 (patch)
tree8891b6ed7c7548f4f5988fcbeb6af5a1ecb6cd07 /src
parent7cca54d2bd7e8e42419210c499e27a1452447330 (diff)
downloadQt-4ed3ee42bae92b0feb5c898e4f0fdf7d34e34108.zip
Qt-4ed3ee42bae92b0feb5c898e4f0fdf7d34e34108.tar.gz
Qt-4ed3ee42bae92b0feb5c898e4f0fdf7d34e34108.tar.bz2
Tablet events get delivered to the widget where the tablet down happend.
This is basically the Windows version of the bug fixed in change 82e825ed841bce324a6892fcbace03f9936d4f4f Merge-request: 855 Reviewed-by: Norwegian Rock Cat <qt-info@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication_win.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index e26d82e..e0c62b7 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2956,7 +2956,9 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
if (alienWidget && alienWidget->internalWinId())
alienWidget = 0;
- if (type == QEvent::MouseMove || type == QEvent::NonClientAreaMouseMove) {
+ if (type == QEvent::MouseMove || type == QEvent::NonClientAreaMouseMove
+ || type == QEvent::TabletMove) {
+
if (!(state & Qt::MouseButtonMask))
qt_button_down = 0;
#ifndef QT_NO_CURSOR
@@ -3087,6 +3089,8 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
popupButtonFocus = popupChild;
break;
case QEvent::MouseButtonRelease:
+ case QEvent::TabletRelease:
+
releaseAfter = true;
break;
default:
@@ -3446,13 +3450,34 @@ bool QETWidget::translateTabletEvent(const MSG &msg, PACKET *localPacketBuf,
}
QPoint globalPos(qRound(hiResGlobal.x()), qRound(hiResGlobal.y()));
+ if (t == QEvent::TabletPress)
+ {
+ qt_button_down = QApplication::widgetAt(globalPos);
+ }
+
// make sure the tablet event get's sent to the proper widget...
- QWidget *w = QApplication::widgetAt(globalPos);
+ QWidget *w = 0;
+
if (qt_button_down)
w = qt_button_down; // Pass it to the thing that's grabbed it.
+ else
+ w = QApplication::widgetAt(globalPos);
if (!w)
w = this;
+
+ if (t == QEvent::TabletRelease)
+ {
+ if (qt_win_ignoreNextMouseReleaseEvent) {
+ qt_win_ignoreNextMouseReleaseEvent = false;
+ if (qt_button_down && qt_button_down->internalWinId() == autoCaptureWnd) {
+ releaseAutoCapture();
+ qt_button_down = 0;
+ }
+ }
+
+ }
+
QPoint localPos = w->mapFromGlobal(globalPos);
#ifndef QT_NO_TABLETEVENT
if (currentTabletPointer.currentDevice == QTabletEvent::Airbrush) {