summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@nokia.com>2009-11-19 15:15:17 +0100
committerJeremy Katz <jeremy.katz@nokia.com>2009-11-19 15:15:17 +0100
commit19689dd51a93668fda2273472985114e86a9b8d5 (patch)
tree7c57c52827c6a5c038efec93bcb8c86f7a0f40e0 /src/gui
parentc357ab6fbb673f75e9f2ccb2da5d3a938eaadf1f (diff)
Report cursor movement to QApplicationPrivate::handleMouseEvent() directly
We had this running through qvnccursor -> QVNCGraphicsSystemScreen -> QApplicationPrivate, but that doesn't work with the generic Linux input plugin.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_lite.cpp4
-rw-r--r--src/gui/painting/qgraphicssystem_p.h5
-rw-r--r--src/gui/painting/qgraphicssystemcursor.cpp5
-rw-r--r--src/gui/painting/qgraphicssystemcursor.h2
4 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/kernel/qapplication_lite.cpp b/src/gui/kernel/qapplication_lite.cpp
index b0f50749bc..f2be5c7c27 100644
--- a/src/gui/kernel/qapplication_lite.cpp
+++ b/src/gui/kernel/qapplication_lite.cpp
@@ -57,6 +57,7 @@
#include <qinputcontext.h>
#include "private/qgraphicssystem_p.h"
+#include "qgraphicssystemcursor.h"
#include <qdebug.h>
@@ -525,6 +526,9 @@ void QApplicationPrivate::handleMouseEvent(QWidget *tlw, const QMouseEvent &ev)
static QWidget *implicit_mouse_grabber=0;
+ if (QGraphicsSystemCursor::instance)
+ QGraphicsSystemCursor::instance->pointerEvent(ev);
+
QPoint localPoint = ev.pos();
QPoint globalPoint = ev.globalPos();
QWidget *mouseWindow = tlw;
diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h
index 1bfca584bb..0b0dfb58fc 100644
--- a/src/gui/painting/qgraphicssystem_p.h
+++ b/src/gui/painting/qgraphicssystem_p.h
@@ -56,6 +56,8 @@
#include "private/qpixmapdata_p.h"
#include "private/qwindowsurface_p.h"
+#include <qdebug.h>
+
QT_BEGIN_NAMESPACE
class QPixmapFilter;
@@ -73,8 +75,7 @@ public:
virtual int depth() const = 0;
virtual QImage::Format format() const = 0;
virtual QSize physicalSize() const = 0;
- virtual void setDirty(QRect) { }
- virtual void pointerEvent(QMouseEvent &) { }
+ virtual void setDirty(const QRect &) {}
virtual QWidget *topLevelAt(const QPoint &point) const;
};
#endif // Q_WS_LITE
diff --git a/src/gui/painting/qgraphicssystemcursor.cpp b/src/gui/painting/qgraphicssystemcursor.cpp
index b919d0a085..6aef76c1c1 100644
--- a/src/gui/painting/qgraphicssystemcursor.cpp
+++ b/src/gui/painting/qgraphicssystemcursor.cpp
@@ -94,13 +94,12 @@ QRect QGraphicsSystemCursor::drawCursor(QPainter & painter)
return prevRect;
}
-void QGraphicsSystemCursor::pointerEvent(QMouseEvent & e)
+void QGraphicsSystemCursor::pointerEvent(const QMouseEvent & e)
{
currentRect = graphic->image()->rect().translated(-graphic->hotspot().x(),
-graphic->hotspot().y());
currentRect.translate(e.pos());
-
- screen->pointerEvent(e);
+ screen->setDirty(QRect(QRect(e.pos(), QSize(1, 1))));
}
void QGraphicsSystemCursor::changeCursor(QCursor * widgetCursor)
diff --git a/src/gui/painting/qgraphicssystemcursor.h b/src/gui/painting/qgraphicssystemcursor.h
index eab72037ce..de7ce84858 100644
--- a/src/gui/painting/qgraphicssystemcursor.h
+++ b/src/gui/painting/qgraphicssystemcursor.h
@@ -73,7 +73,7 @@ public:
// input methods
virtual void setCursor(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY);
virtual void setCursor(Qt::CursorShape shape);
- virtual void pointerEvent(QMouseEvent & event);
+ virtual void pointerEvent(const QMouseEvent & event);
virtual void changeCursor(QWidget * widget);
virtual void changeCursor(QCursor * widgetCursor);