SUMMARY Qt::Tool windows don't regain focus after pop-ups close on X11. STEPS TO REPRODUCE This issue was found when testing [1]. It doesn't impact Wayland. 1. Compile and run [2] (one-liner change based on Yakuake v21.04.2) 2. Execute: printf 'GETPIN\n' | pinentry-qt 3. Enter something random OBSERVED RESULT After pinentry closes, the last regular window gains focus instead of Yakuake. EXPECTED RESULT Yakuake regains focus. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.22.1 KDE Frameworks Version: 5.83.0 Qt Version: 5.15.2 Kernel Version: 5.12.12-zen1-1-zen (64-bit) Graphics Platform: X11 [1] https://invent.kde.org/utilities/yakuake/-/merge_requests/42#note_257687 [2] https://invent.kde.org/frederickzhang/yakuake/commit/b950ee2c6321ef9d9c1259b9bec6cb9e57112c88
Copy of my comment here https://invent.kde.org/utilities/yakuake/-/merge_requests/42#note_288516 This happens because the `Qt::Tool` flag sets the `Qt::WA_X11NetWmWindowTypeUtility` attribute. Making it an utility window which messes with the focus handling. I didn't test this,yet. But clearing the attribute by something like `setAttribute(Qt::WA_X11NetWmWindowTypeUtility, false);` should fix this, I think. Simply forcing the window type to "normal window" with a window rule fixes the issue
Could this also make yakuake not appear in the task switcher? See https://bugs.kde.org/show_bug.cgi?id=441056
Yep, setting the window type to "normal window" made yakuake show up again in the task switcher.
*** Bug 441056 has been marked as a duplicate of this bug. ***
This bug was reported against an outdated version of KWin. We have made many changes since the. If the issue persists in newer versions can you reopen the bug report updating the version number.