[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita] libs/ui/input/wintab: Add a workaround for tablets not reporting tablet events in hover mode
From:       Dmitry Kazakov <null () kde ! org>
Date:       2018-09-14 10:52:03
Message-ID: E1g0lhj-0001nl-I9 () code ! kde ! org
[Download RAW message or body]

Git commit 94151b759b0cd8f7b33fdf857294d2cfe7fac86d by Dmitry Kazakov.
Committed on 14/09/2018 at 10:51.
Pushed by dkazakov into branch 'master'.

Add a workaround for tablets not reporting tablet events in hover mode

The bug is caused by the fact that we postpone tablet events
by one event (presumably to make it sync with mouse events
stream). But some non-wacom tablets do not report tablet
move events when the stylus is hovering. It means that the
following tablet press event will be positioned incorrectly.

This event postponing has come from Qt, and the commit message
says it was needed for "relative" mode, which we don't support.

I just disabled this postponing, let's check whether it helps
people.

BUG:363284

M  +7    -4    libs/ui/input/wintab/kis_tablet_support_win.cpp
M  +0    -1    libs/ui/input/wintab/kis_tablet_support_win_p.h

https://commits.kde.org/krita/94151b759b0cd8f7b33fdf857294d2cfe7fac86d

diff --git a/libs/ui/input/wintab/kis_tablet_support_win.cpp \
b/libs/ui/input/wintab/kis_tablet_support_win.cpp index \
                53748fa30dc..f981caee422 100644
--- a/libs/ui/input/wintab/kis_tablet_support_win.cpp
+++ b/libs/ui/input/wintab/kis_tablet_support_win.cpp
@@ -801,10 +801,13 @@ bool \
QWindowsTabletSupport::translateTabletPacketEvent()  
         const int z = currentDevice == QTabletEvent::FourDMouse ? \
int(packet.pkZ) : 0;  
-        // This code is to delay the tablet data one cycle to sync with \
                the mouse location.
-        QPointF globalPosF = m_oldGlobalPosF / dpr; // Convert from \
                "native" to "device independent pixels."
-        m_oldGlobalPosF = tabletData.scaleCoordinates(packet.pkX, \
                packet.pkY,
-                                                      \
tabletData.virtualDesktopArea); +        // NOTE: we shouldn't postpone the \
tablet events like Qt does, because we +        //       don't support \
mouse mode (which was the reason for introducing this +        //       \
postponing). See bug 363284. +        QPointF globalPosF =
+            tabletData.scaleCoordinates(packet.pkX, packet.pkY,
+                                        tabletData.virtualDesktopArea);
+        globalPosF /= dpr; // Convert from "native" to "device independent \
pixels."  
         QPoint globalPos = globalPosF.toPoint();
 
diff --git a/libs/ui/input/wintab/kis_tablet_support_win_p.h \
b/libs/ui/input/wintab/kis_tablet_support_win_p.h index \
                769720a13eb..fb55f353989 100644
--- a/libs/ui/input/wintab/kis_tablet_support_win_p.h
+++ b/libs/ui/input/wintab/kis_tablet_support_win_p.h
@@ -124,7 +124,6 @@ private:
     bool m_tiltSupport;
     QVector<QWindowsTabletDeviceData> m_devices;
     int m_currentDevice;
-    QPointF m_oldGlobalPosF;
 
 
     QWidget *targetWidget{0};


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic