Summary: | [Windows] Canvas shortcuts break when other application steals focus or holds down global shortcuts | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Tyson Tan <tysontanx> |
Component: | Shortcuts and Canvas Input Settings | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | 15503134230, cavendish.qi, zimin2093354964 |
Priority: | NOR | ||
Version: | 5.2.2 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Krita tablet event log during the issue
Video of Krita's canvas shortcut issue |
Description
Tyson Tan
2024-03-15 15:37:39 UTC
Here I will repeat the important points in Chinese, so people can find this bug report easier. Krita 在 Windows 下面会因为某些其他程序使用激进的手段抢夺窗口焦点而导致 Krita 的画布输入失去修饰键 (Ctrl/Shift/Alt) 和鼠标中键/右键。没有经验的用户体验到的表象是“快捷键失效”、“Ctrl键按下不能拾色”、“无法打开右键弹出面板”、“无法用中键移动画布”等。然而实际上这和快捷键没有关系——单键的快捷键 (如B/E/R/V 等),带修饰键的非画布快捷键 (Ctrl+S 等) 的工作依然是正常的。 以搜狗拼音输入法为例,我的测试发现在以下的任意情况下它会积极地抢夺 Krita 的焦点: 1. 从其他输入法切换到搜狗拼音 2. 显示推广气泡 (在搜狗输入法工具栏上方偶尔出现的单行文字提示,例如推广语音输入、AI写作等功能) 3. 搜狗拼音的语音输入 (麦克风按钮) 点击后打开了语音输入框在实时监听用户输入时 必须将这些气泡、弹窗、对话框全部关闭 (不需要关闭搜狗输入法本身),然后重启 Krita,这样 Krita 的画布快捷键输入才会恢复正常。 我已经将这个问题通过搜狗输入法内建的反馈功能提交给他们了,虽然他们大概率不会做任何事情。 我记得这个问题并不是一直存在的,好象是从 2022 年左右搜狗拼音被重写时才开始陆续发现有人报告这个问题,而且当时貌似很多其他绘画软件也遇到不少奇怪的丢输入的情况。不知道是不是一回事。 虽然有人说微信可能也会导致问题,但是我测试的时候同时打开了QQ、微信、钉钉、B站、网易云音乐、百度网盘、360浏览器等这些常见软件,全部默认设置直接用,它们各自都有推送消息弹窗等,但我并没有遇到任何问题——只有搜狗拼音才会发生问题。 After more investigation, I discovered some important clues that point to Krita/Qt. 1) Krita 4.2.9 was unaffected by this bug. 2) The problem started to happen since 4.3.0beta1. 3) I tested this personally, using binaries from KDE Attic: https://download.kde.org/Attic/krita/ Krita 4.3 Release Notes: https://krita.org/en/release-notes/krita-4-3-release-notes/ Qt version difference: Krita 4.2.9 uses Qt 5.12.7. Krita 4.3.0beta1 uses Qt 5.12.8 Qt 5.12.8 Release Notes: https://www.qt.io/blog/qt-5.12.8-released Fixed bugs in Qt 5.12.8: https://bugreports.qt.io/browse/QTBUG-79192?filter=21875 To add to my discovery in Comment 3: In my initial report Description and Comment 1 I said I was only able to reproduce the issue with Sogou Pinyin Input Method. This turned out to be inaccurate. In reality, almost every popular Instant Messaging app in China was affected. This includes: 1) QQ (the old 9.7.x branch) 2) Dingtalk 3) Weixin These apps require Chinese ID to register an account, so it's not practical for the Krita team to test them. I will include what triggered the issue in these apps below. Tencent QQ (Old branch): https://im.qq.com/ https://im.qq.com/pcqq/index.shtml https://dldir1.qq.com/qqfile/qq/PCQQ9.7.22/QQ9.7.22.240318_01.exe Only the old 9.7.x branch was affected. The recently rewritten 9.9.x branch is unaffected. The old branch was written in C. The new branch is Electron based. The Startup and Login sequence of this old QQ will break Krita's canvas shortcuts. Nothing else. Dingtalk (钉钉): https://www.dingtalk.com/ https://page.dingtalk.com/wow/z/dingtalk/simple/ddhomedownload#/ This app seems to be Qt based. It has Qt 5.15.11 libraries in its installation directory. The Starting up, Login Sequence, New Message Notifications seemed to break Krita's canvas shortcuts. After turning off all of Dingtalk's global hotkeys, I was unable to reproduce this issue anymore. Weixin PC Client (微信 PC 客户端): https://weixin.qq.com/ https://pc.weixin.qq.com/ Weixin PC Client appears to be Electron based. The following behaviors break Krita's canvas shortcuts: 1) The Login of Weixin PC Client bringing up its main window above other apps. 2) The chat dialogue has an "Emotion" button. Clicking this icon to open the Emotion GIF list. 3) Clicking "Mini Programs (小程序)" icon on its Left sidebar opens a special dialogue window. 4) Clicking "Channels (视频号)" icon on its Left sidebar opens a special dialogue window. There is no known workaround for Weixin except avoiding the actions above. On another note, I've also discovered a workaround inside Krita. Whenever Krita lost its Canvas Shortcuts: 1) Click "Choose Workspace" button on the right of Krita's toolbar. 2) Change to another Workspace and back. 3) Krita's Canvas shortcuts is restored temporarily. However, if the upper mentioned 3rd party apps trigger the issue again, Krita will lose its Canvas Shortcuts again. Additionally, when Krita's Canvas Shortcuts are broken: Mouse wheel Up/Down to Zoom is also broken. Possibly because it's also a Canvas Shortcut? I also traced back this issue to a Krita-Artist forum post: https://krita-artists.org/t/4-3-beta-1-certain-keyboard-shortcuts-not-working/7027/9 This user is not Chinese, so this issue is not China specific. And the post is 4.3.0beta1 related. To sum the important new findings up: 1) Something happened between Krita 4.2.9 and 4.3.0beta1 caused this issue. 2) Or maybe something happened between Qt 5.12.7 and 5.12.8 caused it. 3) This is not China specific. 4) Changing Krita's workspace restores Canvas Shortcuts temporarily. Therefore, I think this is indeed a Krita problem. Maybe since 4.3.0beta1, Krita 's canvas focus restore mechanism has been broken. Better to have a minimal example(about the Canvas Shortcuts) to reproduce the bug? And the steps. I can try to record a video with Key stroke visualization, if that's what you mean. I will do it later tonight. I mean code example if possible, Krita is too huge for a qt dev to recompile when trying a "git bisect". I don't think I have the knowledge to do that. Maybe a Krita dev knows how. I will first try to investigate this with the Krita devs, and get back to you if what we found was indeed a Qt bug. Maybe this bug is related to: https://bugs.kde.org/show_bug.cgi?id=462768 Created attachment 168054 [details]
Krita tablet event log during the issue
This tablet event log ended with a suspicious message:
WARNING: modifiers state became inconsistent! Trying to fix that...
inputEvent->modifiers() = QFlags<Qt::KeyboardModifier>(NoModifier)
d->matcher.debugPressedKeys() = QVector(Qt::Key_Shift, Qt::Key_Control, Qt::Key_T, Qt::Key_F22)
It has "modifiers state inconsistant" and the repeatedly reported "F22" key like many other users reported.
Created attachment 168055 [details]
Video of Krita's canvas shortcut issue
*** Bug 449000 has been marked as a duplicate of this bug. *** *** Bug 470354 has been marked as a duplicate of this bug. *** |