summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-09-10 01:39:19 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-09-10 02:35:02 (GMT)
commit1931e4ad18c9547f53f2b454f330ba35871f9774 (patch)
treeb5c32ea809fad17125a0809cab0e3eff6477ddd3
parentdeb4b5f81c27a549aa450fafc22ed77d553cd5a6 (diff)
downloadQt-1931e4ad18c9547f53f2b454f330ba35871f9774.zip
Qt-1931e4ad18c9547f53f2b454f330ba35871f9774.tar.gz
Qt-1931e4ad18c9547f53f2b454f330ba35871f9774.tar.bz2
Fix a bug with mouse events in DirectFB
Partially revert a974ce81d6324d8d85ade0153b5ce7c757ba4fdf. It seems odd to just ignore the actual data in the input event but when the layer and the event differs the layer is correct. Reviewed-by: TrustMe
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
index 0ad4071..8662df6 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
@@ -207,6 +207,7 @@ void QDirectFBMouseHandlerPrivate::readMouseData()
int wheel = 0;
if (input.type == DIET_AXISMOTION) {
+#ifdef QT_NO_DIRECTFB_LAYER
if (input.flags & DIEF_AXISABS) {
switch (input.axis) {
case DIAI_X: x = input.axisabs; break;
@@ -226,6 +227,19 @@ void QDirectFBMouseHandlerPrivate::readMouseData()
"unknown axis (releative) %d", input.axis);
}
}
+#else
+ if (input.axis == DIAI_X || input.axis == DIAI_Y) {
+ DFBResult result = layer->GetCursorPosition(layer, &x, &y);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBMouseHandler::readMouseData",
+ result);
+ }
+ } else if (input.axis == DIAI_Z) {
+ Q_ASSERT(input.flags & DIEF_AXISREL);
+ wheel = input.axisrel;
+ wheel *= -120;
+ }
+#endif
}
Qt::MouseButtons buttons = Qt::NoButton;