From 1931e4ad18c9547f53f2b454f330ba35871f9774 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 9 Sep 2009 18:39:19 -0700 Subject: 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 --- src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; -- cgit v0.12