This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Krita loses keyboard focus on exiting color selector popup

Tags: None
(comma "," separated)
User avatar
rksk16it
Registered Member
Posts
21
Karma
0
OS
I am on Arch linux, with all the upgrades as of this minute :
kernel: 5.1.7
video driver: nvidia: 430.14
Qt: 5.12.3

I have tested this bug on both the installed Krita (4.2.1) and Krita Plus nightly (krita-4.2.1-468f9b4-x86_64.appimage) .

I have bound the popup color selector to key 'W'. I press W, popup appears, I pick the color. Everything is fine upto this point. But now there are two ways I can close the popup and go back to the drawing canvas :

1. I press W again, the popup closes and everything works fine.
2. I move the mouse outside the popup. The popup closes but now no keyboard shortcut works.

In case#2 above, I can draw fine use mouse/tablet, and can click on menus etc, but keyboard shortcuts stop working entirely. All shortcuts, not just color selector popup. But it gets restored if I alt-tab to other window and come back, or if there is a floating docker and I activate it and then come back to canvas.

To investigate, I downloaded the krita's source code of the nightly plus and installed a native event filter via qApp->installNativeEventFilter. In there, I added the following code (showing only the relevant parts) :
Code: Select all
        case XCB_KEY_PRESS: {
          qDebug() << "xcb key pressed...";
        }
        break;
        case XCB_FOCUS_IN: {
          auto e = reinterpret_cast<xcb_focus_in_event_t*>(event);
          qDebug() << "xcb focus in, seq:" << e->sequence << ", window:" << e->event ;
        }
        break;
        case XCB_FOCUS_OUT: {
          auto e = reinterpret_cast<xcb_focus_in_event_t*>(event);
          qDebug() << "xcb focus out, seq:" << e->sequence << ", window:" << e->event ;
        }
        break;


So I was just inspecting the keypress events, and focus in/out events from xcb. And I ran both the above cases, exiting popup by pressing W again, and then exiting popup by just moving the mouse outside.

When entering with W keypress and then exiting with W keypress, following was the output from my debug code :
xcb key pressed... // <-- I pressed W to open popup
xcb focus out, seq: 4323 , window: 62914587 // <-- Main window loses focus
xcb focus in, seq: 4323 , window: 62915105 // <-- Popup window gains focus
xcb key pressed... // <-- I pressed W to close popup
xcb focus out, seq: 4373 , window: 62915105 // <-- Popup window loses focus
xcb focus out, seq: 4374 , window: 62914587 // <-- Main window loses focus
xcb focus in, seq: 4395 , window: 62914587 // <-- Main window gains focus


You can see, in the end, the main window ends up gaining focus, so this works fine. But now the output if I exit popup by just moving my mouse outside :

xcb key pressed... // <-- I pressed W to open popup
xcb focus out, seq: 4445 , window: 62914587 // <-- Main window loses focus
xcb focus in, seq: 4445 , window: 62915105 // <-- Popup window gains focus
xcb focus out, seq: 4500 , window: 62915105 // <-- Popup window loses focus
xcb focus in, seq: 4500 , window: 62914587 // <-- Main window gains focus
xcb focus out, seq: 4505 , window: 62914587 // <-- Main window loses focus


There is the problem, the main window ends up losing keyboard focus. Now no "xcb key pressed..." happens no matter whatever key I press. If I alt-tab out and then in, or give focus to a floating docker and then go back, then it fixes itself.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
At first I thought it would be something like https://bugs.kde.org/show_bug.cgi?id=407978, which is also Arch specific, but in that report testers report that the appimage is fine.

If I test this on my KDE Neon system, with Qt 5.12.0, I don't have any problems, but I also don't have any problems with the 4.2.1 appimage on this system, which has Qt 5.12.3.
User avatar
rksk16it
Registered Member
Posts
21
Karma
0
OS
Yeah I suspected that this issue is very specific to certain setups, cuz it was there even in 4.2.0 and if it was widespread, it would've been noticed by now. I use Xfce desktop environment, maybe it has to do something with it, not sure though. Going to dig more into this.
User avatar
rksk16it
Registered Member
Posts
21
Karma
0
OS
Yeah, it was xfwm, xfce's window manager. Installed cinnamon desktop environment and its working fine now.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
Ha! Okay -- maybe it would make sense to report a bug to the xfce people?
User avatar
rksk16it
Registered Member
Posts
21
Karma
0
OS
boudewijn wrote:Ha! Okay -- maybe it would make sense to report a bug to the xfce people?


The version which was installed by system package manager is quite a bit behind, and I dont understand how they version it, probably the 4.X are stable if X is even and unstable if X is odd. The installed one I have is 4.12, whereas 4.13 branches are available there. This is why I didnt immediately filed a report because I cannot compile and test their latest versions. I will see if there is any mention of any keyboard focus related bugs in their changelogs or anywhere, if not then maybe drop them a message first before opening an issue on their bug tracker.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
Cool, thanks for the update :-)


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot]