Bug 454256 - [REG:5.0.2] Canvas input stops working after using shortcut with non-Latin keyboard
Summary: [REG:5.0.2] Canvas input stops working after using shortcut with non-Latin ke...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Shortcuts and Canvas Input Settings (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR critical
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: regression, release_blocker
: 452626 452771 452910 453972 454450 (view as bug list)
Depends on:
Blocks: 453271 453757 452626 452771 452885 452910 453972 454110 454141 454254 454450
  Show dependency treegraph
 
Reported: 2022-05-23 08:21 UTC by Alvin Wong
Modified: 2022-06-13 06:41 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alvin Wong 2022-05-23 08:21:09 UTC
Steps to reproduce:

1. Add Greek keyboard
2. Switch to Greek keyboard
3. Open document in Krita
4. Hold Ctrl
5. Hold Z
6. Release Ctrl
7. Release Z
8. Hold space (or use middle mouse button) and try to pan canvas


Tablet log (Greek keyboard), when Ctrl is released before Z (**breaks** canvas input):

[25392] krita.tabletlog: "[       ] ShortcutOverride key: 0x1000021 mod: 0x4000000 text: none"
[25392] krita.tabletlog: "[       ] ShortcutOverride key: 0x5a mod: 0x4000000 text: \u001A"
[25392] krita.tabletlog: "[       ] KeyRelease       key: 0x1000021 mod: 0x0 text: none"
[25392] krita.tabletlog: "[       ] KeyRelease       key: 0x396 mod: 0x0 text: \u001A"

Tablet log (Greek keyboard), when Ctrl is released after Z (canvas input continue to work):

[25392] krita.tabletlog: "[       ] ShortcutOverride key: 0x1000021 mod: 0x4000000 text: none"
[25392] krita.tabletlog: "[       ] ShortcutOverride key: 0x5a mod: 0x4000000 text: \u001A"
[25392] krita.tabletlog: "[       ] KeyRelease       key: 0x5a mod: 0x4000000 text: \u001A"
[25392] krita.tabletlog: "[       ] KeyRelease       key: 0x1000021 mod: 0x0 text: none"

Tablet log (US keyboard) when Ctrl is released before Z (canvas input continue to work):

[14860] krita.tabletlog: "[       ] ShortcutOverride key: 0x1000021 mod: 0x4000000 text: none"
[14860] krita.tabletlog: "[       ] ShortcutOverride key: 0x5a mod: 0x4000000 text: \u001A"
[14860] krita.tabletlog: "[       ] KeyRelease       key: 0x1000021 mod: 0x0 text: none"
[14860] krita.tabletlog: "[       ] KeyRelease       key: 0x5a mod: 0x0 text: \u001A"



(Nightly c356cf83d5)
Comment 1 Alvin Wong 2022-05-23 08:55:43 UTC
Reverting https://invent.kde.org/graphics/krita/-/commit/58392a1f9ae446da3f48c632f2bfe68d10a60ee4 fixes this, but of course that brings back bug 438784.
Comment 2 Dmitry Kazakov 2022-05-23 11:39:32 UTC
I can still reproduce the issue with this commit reverted: https://invent.kde.org/graphics/krita/-/commit/58392a1f9ae446da3f48c632f2bfe68d10a60ee4

I can also reproduce the issue on Linux.
Comment 3 amyspark 2022-05-24 14:59:17 UTC
Can reproduce in git commit a792621 on macOS Big Sur 11.6.5 (MBP Early 2015).
Comment 4 amyspark 2022-05-24 15:00:15 UTC
It should be noted that in macOS, the pan action gets compressed until the space bar is released, after which all the movements get applied at once.
Comment 5 Dmitry Kazakov 2022-05-26 08:58:03 UTC
Git commit d518783ca601fdc7f4d934cee01067137cc8f08e by Dmitry Kazakov.
Committed on 26/05/2022 at 08:56.
Pushed by dkazakov into branch 'master'.

Fix unbalanced KeyPress/Release on non-latin keyboard on Linux

Key release should come for exactly the same qt-key that was pressed
before to keep them balanced. Even when the modifiers state changes
in the meantime.

A  +96   -0    3rdparty/ext_qt/0001-Fix-unbalanced-KeyPress-Release-on-non-latin-keyboar.patch
M  +1    -1    3rdparty/ext_qt/CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/d518783ca601fdc7f4d934cee01067137cc8f08e
Comment 6 Dmitry Kazakov 2022-05-26 09:04:25 UTC
Git commit d682f0f5b17f64494a718652cb4ea733f725d83c by Dmitry Kazakov.
Committed on 26/05/2022 at 09:04.
Pushed by dkazakov into branch 'master'.

[win] Fix unbalanced KeyPress/Release events when using non-latin layout on Windows

When the key is released with a different set of modifiers, we should
notify application about the release of the old key, not the new one.
E.g. for '2' vs '@' keys.

A  +103  -0    3rdparty/ext_qt/0001-win-Fix-unbalanced-KeyPress-Release-events-when-usin.patch
M  +1    -0    3rdparty/ext_qt/CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/d682f0f5b17f64494a718652cb4ea733f725d83c
Comment 7 Dmitry Kazakov 2022-05-27 13:29:20 UTC
I've reported an upstream bug here: https://bugreports.qt.io/browse/QTBUG-103868

PS:

The bug is still **not** fixed on macOS! It needs a separate patch.
Comment 8 Alvin Wong 2022-06-02 15:15:34 UTC
*** Bug 453972 has been marked as a duplicate of this bug. ***
Comment 9 Alvin Wong 2022-06-02 15:17:00 UTC
*** Bug 452910 has been marked as a duplicate of this bug. ***
Comment 10 Alvin Wong 2022-06-02 15:18:20 UTC
*** Bug 452771 has been marked as a duplicate of this bug. ***
Comment 11 Alvin Wong 2022-06-02 15:18:40 UTC
*** Bug 452626 has been marked as a duplicate of this bug. ***
Comment 12 Alvin Wong 2022-06-02 15:26:00 UTC
*** Bug 454450 has been marked as a duplicate of this bug. ***
Comment 13 Bug Janitor Service 2022-06-10 05:05:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1470
Comment 14 Dmitry Kazakov 2022-06-12 06:39:20 UTC
Git commit 8184f93df3d0d67ed5ad534871c333802ad33b97 by Dmitry Kazakov.
Committed on 12/06/2022 at 06:38.
Pushed by dkazakov into branch 'master'.

Add a workaround for unbalanced key events on macOS

We have a proper fix for Linux and Windows in a form of a patch
for Qt, but we still need a workaround for macOS.

Qt bug: https://bugreports.qt.io/browse/QTBUG-103868

M  +52   -0    libs/ui/input/kis_input_manager.cpp
M  +13   -0    libs/ui/input/kis_input_manager_p.cpp
M  +3    -0    libs/ui/input/kis_input_manager_p.h
M  +2    -1    libs/ui/input/kis_tablet_debugger.cpp

https://invent.kde.org/graphics/krita/commit/8184f93df3d0d67ed5ad534871c333802ad33b97
Comment 15 Dmitry Kazakov 2022-06-12 06:39:44 UTC
Git commit cfbfc96940e2e30dd2d307f24764cc52aae1d235 by Dmitry Kazakov.
Committed on 12/06/2022 at 06:38.
Pushed by dkazakov into branch 'master'.

Enable unbalanced key-events workaround for Linux distributions

M  +8    -0    libs/ui/input/kis_input_manager_p.cpp

https://invent.kde.org/graphics/krita/commit/cfbfc96940e2e30dd2d307f24764cc52aae1d235
Comment 16 Dmitry Kazakov 2022-06-13 06:41:14 UTC
Git commit 7be72b55bdd711d1df5825a3e134ba97722fc997 by Dmitry Kazakov.
Committed on 13/06/2022 at 06:39.
Pushed by dkazakov into branch 'krita/5.1'.

Enable unbalanced key-events workaround for Linux distributions

M  +8    -0    libs/ui/input/kis_input_manager_p.cpp

https://invent.kde.org/graphics/krita/commit/7be72b55bdd711d1df5825a3e134ba97722fc997
Comment 17 Dmitry Kazakov 2022-06-13 06:41:22 UTC
Git commit e822a4c673459fb5b39625709ceed6c0da8d16b0 by Dmitry Kazakov.
Committed on 13/06/2022 at 06:39.
Pushed by dkazakov into branch 'krita/5.1'.

Add a workaround for unbalanced key events on macOS

We have a proper fix for Linux and Windows in a form of a patch
for Qt, but we still need a workaround for macOS.

Qt bug: https://bugreports.qt.io/browse/QTBUG-103868

M  +52   -0    libs/ui/input/kis_input_manager.cpp
M  +13   -0    libs/ui/input/kis_input_manager_p.cpp
M  +3    -0    libs/ui/input/kis_input_manager_p.h
M  +2    -1    libs/ui/input/kis_tablet_debugger.cpp

https://invent.kde.org/graphics/krita/commit/e822a4c673459fb5b39625709ceed6c0da8d16b0