Summary: | Touch docker commands sometimes gets triggered twice | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Alvin Wong <alvin> |
Component: | Dockers | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dimula73 |
Priority: | NOR | ||
Version: | 4.4.3 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
URL: | https://bugreports.qt.io/browse/QTBUG-95058 | ||
Latest Commit: | https://invent.kde.org/graphics/krita/commit/d76fe492bf0b883f0d2b9d3bd70ef161af2a29c7 | Version Fixed In: |
Description
Alvin Wong
2021-05-16 11:01:08 UTC
@Dmitry: I traced the window messages and seem to have found a pattern. This is how the messages seem to arrive: 1. When drawing a stroke, WM_POINTERDOWN / WM_POINTERUPDATE / WM_POINTERUP are received for the pen input. 2. Synthesized WM_LBUTTONDOWN / WM_MOUSEMOVE / WM_LBUTTONUP are also received. 3. As the pen is released and the touch docker is touched, WM_POINTERDOWN / WM_POINTERUPDATE / WM_POINTERUP are received for the touch point. 4. Synthesized WM_TOUCH messages are also received. 5. Finally, synthesized WM_LBUTTONDOWN / WM_LBUTTONUP are received. Whenever the command gets triggered twice, however, the window received extra WM_PINTERUPDATE messages generated from the pen moving, in between item 3 and 5. Effectively, you don't need to draw on the canvas to trigger the bug. Simply shaking the pen hovering on the canvas and touching the touch docker buttons at the same time can trigger the bug. I suspect this to be the culprit: https://invent.kde.org/qt/qt/qtbase/-/commit/786c58817187bb18552934c807ba7a7ea845f49e#5fba19dc9f238dadbe8c1589df5a5f8c5c8a8537_732_734 I'm not sure if it is safe to just revert that commit though, since it does mention Qt Quick relies on this. What do you think? P.S. the code comment states that "using the bit 7 of the extra msg info for checking if synthesized for touch does not work", but I suspect it is related to the thing where Windows starts synthesizing touch events from pen input since 1709. Opened upstream bug https://bugreports.qt.io/browse/QTBUG-95058 A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/952 Git commit 5207263943ae93e7098db0f33b57cfb0c92d7bff by Dmitry Kazakov, on behalf of Alvin Wong. Committed on 19/07/2021 at 08:36. Pushed by dkazakov into branch 'master'. win: Work around touch docker buttons triggering twice Hack around the issue by blocking certain mouse events in the touch docker. See also: https://bugreports.qt.io/browse/QTBUG-95058 M +6 -0 plugins/dockers/touchdocker/CMakeLists.txt M +8 -0 plugins/dockers/touchdocker/TouchDockerDock.cpp A +93 -0 plugins/dockers/touchdocker/TouchDockerQQuickWidget.cpp [License: GPL(v3.0+)] A +40 -0 plugins/dockers/touchdocker/TouchDockerQQuickWidget.h [License: GPL(v3.0+)] https://invent.kde.org/graphics/krita/commit/5207263943ae93e7098db0f33b57cfb0c92d7bff Git commit d76fe492bf0b883f0d2b9d3bd70ef161af2a29c7 by Dmitry Kazakov, on behalf of Alvin Wong. Committed on 19/07/2021 at 08:38. Pushed by dkazakov into branch 'krita/5.0'. win: Work around touch docker buttons triggering twice Hack around the issue by blocking certain mouse events in the touch docker. See also: https://bugreports.qt.io/browse/QTBUG-95058 M +6 -0 plugins/dockers/touchdocker/CMakeLists.txt M +8 -0 plugins/dockers/touchdocker/TouchDockerDock.cpp A +93 -0 plugins/dockers/touchdocker/TouchDockerQQuickWidget.cpp [License: GPL(v3.0+)] A +40 -0 plugins/dockers/touchdocker/TouchDockerQQuickWidget.h [License: GPL(v3.0+)] https://invent.kde.org/graphics/krita/commit/d76fe492bf0b883f0d2b9d3bd70ef161af2a29c7 |