Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/input/wintab/qxcbconnection.cpp
Show First 20 Lines • Show All 576 Lines • ▼ Show 20 Line(s) | |||||
577 | Qt::MouseButtons tabletState = Qt::NoButton; | 577 | Qt::MouseButtons tabletState = Qt::NoButton; | ||
578 | QPointer<QWidget> tabletPressWidget = 0; | 578 | QPointer<QWidget> tabletPressWidget = 0; | ||
579 | 579 | | |||
580 | void QWindowSystemInterface::handleTabletEvent(QWindow *w, const QPointF &local, const QPointF &global, | 580 | void QWindowSystemInterface::handleTabletEvent(QWindow *w, const QPointF &local, const QPointF &global, | ||
581 | int device, int pointerType, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt, | 581 | int device, int pointerType, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt, | ||
582 | qreal tangentialPressure, qreal rotation, int z, qint64 uid, | 582 | qreal tangentialPressure, qreal rotation, int z, qint64 uid, | ||
583 | Qt::KeyboardModifiers modifiers) | 583 | Qt::KeyboardModifiers modifiers) | ||
584 | { | 584 | { | ||
585 | qint64 timestamp = g_eventTimer.elapsed(); | 585 | qint64 timestamp = g_eventTimer.msecsSinceReference() + g_eventTimer.elapsed(); | ||
586 | 586 | | |||
587 | QWindowSystemInterfacePrivate::TabletEvent *e = | 587 | QWindowSystemInterfacePrivate::TabletEvent *e = | ||
588 | new QWindowSystemInterfacePrivate::TabletEvent(w, timestamp, local, global, device, pointerType, buttons, pressure, | 588 | new QWindowSystemInterfacePrivate::TabletEvent(w, timestamp, local, global, device, pointerType, buttons, pressure, | ||
589 | xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers); | 589 | xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers); | ||
590 | 590 | | |||
591 | processTabletEvent(e); | 591 | processTabletEvent(e); | ||
592 | } | 592 | } | ||
593 | 593 | | |||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 596 | #ifndef QT_NO_TABLETEVENT | |||
677 | tabletState = e->buttons; | 677 | tabletState = e->buttons; | ||
678 | #else | 678 | #else | ||
679 | Q_UNUSED(e) | 679 | Q_UNUSED(e) | ||
680 | #endif | 680 | #endif | ||
681 | } | 681 | } | ||
682 | 682 | | |||
683 | void QWindowSystemInterface::handleTabletEnterProximityEvent(int device, int pointerType, qint64 uid) | 683 | void QWindowSystemInterface::handleTabletEnterProximityEvent(int device, int pointerType, qint64 uid) | ||
684 | { | 684 | { | ||
685 | qint64 timestamp = g_eventTimer.elapsed(); | 685 | qint64 timestamp = g_eventTimer.msecsSinceReference() + g_eventTimer.elapsed(); | ||
686 | 686 | | |||
687 | QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(), | 687 | QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(), | ||
688 | device, pointerType, 0, 0, 0, | 688 | device, pointerType, 0, 0, 0, | ||
689 | 0, 0, 0, | 689 | 0, 0, 0, | ||
690 | Qt::NoModifier, uid, Qt::NoButton, tabletState); | 690 | Qt::NoModifier, uid, Qt::NoButton, tabletState); | ||
691 | ev.setTimestamp(timestamp); | 691 | ev.setTimestamp(timestamp); | ||
692 | QGuiApplication::sendEvent(qGuiApp, &ev); | 692 | QGuiApplication::sendEvent(qGuiApp, &ev); | ||
693 | } | 693 | } | ||
694 | 694 | | |||
695 | void QWindowSystemInterface::handleTabletLeaveProximityEvent(int device, int pointerType, qint64 uid) | 695 | void QWindowSystemInterface::handleTabletLeaveProximityEvent(int device, int pointerType, qint64 uid) | ||
696 | { | 696 | { | ||
697 | qint64 timestamp = g_eventTimer.elapsed(); | 697 | qint64 timestamp = g_eventTimer.msecsSinceReference() + g_eventTimer.elapsed(); | ||
698 | 698 | | |||
699 | QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(), | 699 | QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(), | ||
700 | device, pointerType, 0, 0, 0, | 700 | device, pointerType, 0, 0, 0, | ||
701 | 0, 0, 0, | 701 | 0, 0, 0, | ||
702 | Qt::NoModifier, uid, Qt::NoButton, tabletState); | 702 | Qt::NoModifier, uid, Qt::NoButton, tabletState); | ||
703 | ev.setTimestamp(timestamp); | 703 | ev.setTimestamp(timestamp); | ||
704 | QGuiApplication::sendEvent(qGuiApp, &ev); | 704 | QGuiApplication::sendEvent(qGuiApp, &ev); | ||
705 | } | 705 | } | ||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |