Bug 426632

Summary: The Emoji Picker should raise and focus when using the shortcut if it is already open
Product: [Plasma] plasmashell Reporter: Marcus Harrison <marcus>
Component: Emoji SelectorAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.lohnau, nate, skierpage
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=423857
Latest Commit: Version Fixed In: 5.21

Description Marcus Harrison 2020-09-17 07:29:52 UTC
With default Window Focus Behaviour settings on X11, using the emoji selector global shortcut when it is already open does not raise or focus the window.

This makes using it annoying if the user doesn't remember to close it every time they're finished, having to search through their open windows for it.
Comment 1 Alexander Lohnau 2020-09-17 07:59:08 UTC
The window is raised, see applets/kimpanel/backend/ibus/emojier/emojier.cpp:380, also see https://doc.qt.io/qt-5/qwindow.html#show.

And this bug seems related to BUG 388562.
Comment 2 Marcus Harrison 2020-09-17 21:13:03 UTC
Alright, as I was doing more testing I found that this problem occurs with Plasma Discover as well, another QML(/Kirigami?) application. It will open packages/the updates page/etc. to requests, but not raise and focus the window.

I've created a new user to test and found that this happens in a clean environment for both applications. Seems likely to be a Kirigami bug.
Comment 3 Marcus Harrison 2020-09-17 21:16:36 UTC
I tested with Spectacle, a QWidgets application, and it does _not_ exhibit this behaviour. Pressing the Screenshot button when the application is out of focus will correctly raise and focus Spectacle.

System information, since I forgot to add it:

Operating System: KDE neon 5.19
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.0
Kernel Version: 5.4.0-47-generic
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 3.8 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Comment 4 Nate Graham 2020-09-18 21:14:29 UTC
I I recall that this is a regression in ApplicationLauncherJob: KWin isn't honoring the focus request because it thinks it's focus stealing because the job isn't marking the request correctly as a user-initiated action or something.

I think we have a master bug tracking this somewhere...
Comment 5 Nate Graham 2020-09-19 00:09:00 UTC
Found it.

*** This bug has been marked as a duplicate of bug 423857 ***
Comment 6 skierpage 2020-11-24 06:04:42 UTC
*** Bug 429573 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2021-01-04 16:27:24 UTC
Un-duping since the emoji picker will need an app-specific fix for this; see https://invent.kde.org/frameworks/kdbusaddons/-/merge_requests/5.
Comment 8 Nate Graham 2021-01-04 16:27:54 UTC
*** Bug 429573 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2021-01-05 03:20:21 UTC
Git commit 9737ec943980d8e9d6a23d0b0c45e5bd0deafd04 by Nate Graham.
Committed on 05/01/2021 at 03:18.
Pushed by ngraham into branch 'master'.

[emojier] Set window ID so it can be raised when already open
FIXED-IN: 5.21

M  +1    -1    applets/kimpanel/backend/ibus/emojier/CMakeLists.txt
M  +7    -0    applets/kimpanel/backend/ibus/emojier/emojier.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/9737ec943980d8e9d6a23d0b0c45e5bd0deafd04