summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Bertini <matteo@naufraghi.net>2015-02-18 17:10:41 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2015-03-26 14:19:22 +0000
commit363c9aba772b20d2df9070be730ffb36775b6f2b (patch)
tree03cd7d9dc410ff774e74ea4e0d9dd458f95eeca5
parentab3c64522b8ebf51727c7721c361524fa509f630 (diff)
downloadqt4-tools-363c9aba772b20d2df9070be730ffb36775b6f2b.tar.gz
Identify XButton1|2 release events when mouse is moving.
X11 has no special state for XButton1 and XButton2, so we need to look at the global `mouseButtonState` and restore the buttons after a mouse move. Task-number: QTBUG-40148 Change-Id: I789f32b344cf7902b1c7aa6b7da7f20f32602be2 Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
-rw-r--r--src/gui/kernel/qapplication_x11.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index ba8bc1a624..a198fd931b 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -4189,6 +4189,12 @@ static Qt::MouseButtons translateMouseButtons(int s)
ret |= Qt::MidButton;
if (s & Button3Mask)
ret |= Qt::RightButton;
+ // X11 has no special state for XButton1 and XButton2, so we need to use
+ // the global state maintained between press and release.
+ if (mouseButtonState.testFlag(Qt::XButton1))
+ ret |= Qt::XButton1;
+ if (mouseButtonState.testFlag(Qt::XButton2))
+ ret |= Qt::XButton2;
return ret;
}