Cetrain key combinations dont work after switching workspace to Krita (Linux)

Hi everyone,

I have an issue that I think is a bug, but I’m posting here to check first. The issue I’m facing is that whenever I switch to a workspace that has a krita window using a keyboard shortcut, the krita window does not detect certain key presses until I manually refocus it somehow. On i3, I just have to do an in-place restart and things begin working again. On XFCE, I just need to alt-tab into the krita window (even if the window is already focused) for things to work again.

Some of the things that stop working are: using 4 and 6 to rotate the canvas, shift click and dragging to resize the brush, and control clicking to pick a color.
Most things still do work though: drawing still works fine, control-z works to undo things, etc.

I’m guessing this has something to do with the canvas itself not properly receiving a focus event for some reason.

Anyway, I’m mostly looking for confirmation that this is indeed a bug so I can report it on the bug tracker. Thanks in advance.

Hello and welcome to the forum :slight_smile:

I usually simply click on a desktop workspace to select it but I tried setting a keyboard shortcut to switch workspaces on the MATE destop on Debian and then get a similar situation.
The krita titlebar was blue which usually means it has focus.

4 and 5 did not work to rotate the krita canvas.
Left-click and drag did not draw on the canvas, it changed the brush size.

The way to recover from this is to refocus the krita main window by some method, clicking on the window titlebar being the simplest way.

If you switch workspace away from krita but don’t use any other open application or do anything that causes a window to open, you can go back to krita and use it with no problem. So it seems to be that any loss of focus is not recovered by switching the workspace back with a keyboard shortcut.

Doesn’t this indicate that it’s a problem with the desktop manager rather than krita?

Hi, thanks for the welcome!

I didn’t think it was a problem with the desktop manager because krita definitely is getting focused. It seems like the canvas itself isn’t properly getting focus, which seems more likely to be a bug in krita. I’m guessing that the issue is something like krita doesn’t properly handle focuses that don’t correspond to a mouse button click, although that doesn’t explain why alt-tabbing works.
Also, it seems kind of unlikely that this is a bug with all of i3, XFCE, and MATE, doesn’t it?

Unlikely things do happen so I thought I’d mention it :slight_smile:
However, it looks like this is a problem particular to krita.

I’ve just tried this with workspace switching shortcuts that do not involve the Ctrl or Shift or Alt keys (and are not common with krita keyboard shortcuts) and there were no problems that I coud notice. I used F8 to switch to the left and F9 to switch to the right on a 4-workspace desktop.

If I use Ctrl+, Ctrl+Shift+, Alt+, etc types of shortcut then one of those keys is ‘remembered’ and is then forced.
e.g. if I use a Ctrl+ shortcut, I get the colour picker permanently on the canvas and to get rid of it I have to click on the Toolbar or a menu item.
Using a Shift+ shortcut, trying to paint results in the brush size changing, i.e. the Shift key is being forced in some way.
Using an Alt+ shortcut, the 4 and 5 rotation keys don’t work unless I ‘restore’ it as noted above.

GIMP uses the Ctrl key to bring up a colour picker and uses the Shift key to switch to line drawing mode but it doesn’t have the same problem, or any problem that I can see, when its workspace is switched to by those methods.

If you can raise a bug report at https://bugs.kde.org/ and then post the link to it here, that would draw the attention of the developers and I can go in and Confirm it.

Thanks so much for your help, and sorry about the delay. I have opened the issue here: https://bugs.kde.org/show_bug.cgi?id=428080

Something very similar has been seen before on Windows 10 in this topic:

Thank you for raising the bug report. I’ll try to have a closer look at this.