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/inpu= t/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::translateTabletPacketEven= t() = const int z =3D currentDevice =3D=3D QTabletEvent::FourDMouse ? in= t(packet.pkZ) : 0; = - // This code is to delay the tablet data one cycle to sync with th= e mouse location. - QPointF globalPosF =3D m_oldGlobalPosF / dpr; // Convert from "nat= ive" to "device independent pixels." - m_oldGlobalPosF =3D tabletData.scaleCoordinates(packet.pkX, packet= .pkY, - tabletData.virtualDe= sktopArea); + // NOTE: we shouldn't postpone the tablet events like Qt does, bec= ause we + // don't support mouse mode (which was the reason for introd= ucing this + // postponing). See bug 363284. + QPointF globalPosF =3D + tabletData.scaleCoordinates(packet.pkX, packet.pkY, + tabletData.virtualDesktopArea); + globalPosF /=3D dpr; // Convert from "native" to "device independe= nt pixels." = QPoint globalPos =3D globalPosF.toPoint(); = diff --git a/libs/ui/input/wintab/kis_tablet_support_win_p.h b/libs/ui/inpu= t/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 m_devices; int m_currentDevice; - QPointF m_oldGlobalPosF; = = QWidget *targetWidget{0};