summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-06-16 14:09:38 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-07-11 11:10:51 +0200
commit5c92d21cce18eef9b57f42323b464b6670124c3a (patch)
tree9808c94ee25ae61ee9e490b95273a7021b4b284c /src/plugins/platforms/xcb/qxcbconnection.h
parent0cbebb21cc4406059eac19f026e67549a195d089 (diff)
xcb: QTabletEvents and proximity events correctly identify the tool
The tool is enum TabletDevice reported in QTabletEvent::device(). Each type of tool for each type of tablet has an ID which needs to be mapped to this enum. The meaning of the AbsWheel valuator depends on the tool type: an airbrush sends tangentialPressure in the range -1..+1, whereas an Art Pen (RotationStylus) sends rotation in degrees. Because the evdev driver sends valuator changes individually, we have to store the current value in each TabletData::ValuatorClassInfo to ensure that each QTabletEvent has complete state information. [ChangeLog][Platform Specific Changes][X11 / XCB] QTabletEvents and proximity events correctly identify the tool in use; the meaning of certain valuators depends on the tool; and the valuators' current values are not lost between events Task-number: QTBUG-39666 Task-number: QTBUG-39573 Task-number: QTBUG-39570 Change-Id: I6be242ee57e2ad0848060e04f20c0dd08954a734 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 0bfc2f8f76..60a4efff4e 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -507,22 +507,25 @@ private:
int m_xiOpCode, m_xiEventBase, m_xiErrorBase;
#ifndef QT_NO_TABLETEVENT
struct TabletData {
- TabletData() : deviceId(0), down(false), serialId(0), inProximity(false) { }
+ TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer),
+ tool(QTabletEvent::Stylus), down(false), serialId(0), inProximity(false) { }
int deviceId;
QTabletEvent::PointerType pointerType;
+ QTabletEvent::TabletDevice tool;
bool down;
qint64 serialId;
bool inProximity;
struct ValuatorClassInfo {
- ValuatorClassInfo() : minVal(0), maxVal(0) { }
+ ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { }
double minVal;
double maxVal;
+ double curVal;
int number;
};
QHash<int, ValuatorClassInfo> valuatorInfo;
};
bool xi2HandleTabletEvent(void *event, TabletData *tabletData);
- void xi2ReportTabletEvent(const TabletData &tabletData, void *event);
+ void xi2ReportTabletEvent(TabletData &tabletData, void *event);
QVector<TabletData> m_tabletData;
#endif
struct ScrollingDevice {