diff --git a/libs/ui/input/kis_input_manager_p.h b/libs/ui/input/kis_input_manager_p.h --- a/libs/ui/input/kis_input_manager_p.h +++ b/libs/ui/input/kis_input_manager_p.h @@ -130,6 +130,8 @@ bool hungry{false}; // Continue eating mouse strokes bool peckish{false}; // Eat a single mouse press event bool eatSyntheticEvents{true}; // Mask all synthetic events + bool lastEventWasTabletPress{false}; + QPointF lastPressPosition; }; EventEater eventEater; diff --git a/libs/ui/input/kis_input_manager_p.cpp b/libs/ui/input/kis_input_manager_p.cpp --- a/libs/ui/input/kis_input_manager_p.cpp +++ b/libs/ui/input/kis_input_manager_p.cpp @@ -59,6 +59,10 @@ * but is now removed. The second case is currently handled by the * eatOneMousePress function, which waits as long as necessary to detect and * block a single mouse press event. + * + * We also need to watch out for TabletMove immediately following a TabletPress + * carrying the same coordinates. This happens with certain Windows drivers and + * can disturb the bezier smoothing. */ static bool isMouseEventType(QEvent::Type t) @@ -89,10 +93,28 @@ return true; } else if (isMouseEventType(event->type()) && (hungry || (eatSyntheticEvents && static_cast(event)->source() != 0))) { - // Drop mouse events if enabled or event was synthetic & synthetic events are disabled + // Drop mouse events if eventeater is hungry or event was synthetic & + // synthetic events are disabled debugEvent(); return true; } + + // Watch for TabletMove following TabletPress with the same coordinates + if (event->type() == QEvent::TabletPress) { + lastEventWasTabletPress = true; + lastPressPosition = static_cast(event)->globalPosF(); + } + else if (lastEventWasTabletPress == true && event->type() == QEvent::TabletMove) { + lastEventWasTabletPress = false; + if (lastPressPosition == static_cast(event)->globalPosF()) { + // Event came with repeated coordinates so drop it. + return true; + } + } + else { + lastEventWasTabletPress = false; + } + return false; // All clear - let this one through! }