This started happening with the work to make panels keyboard-navigable, but I have been too lazy to report it until now. :( To reproduce the issue, activate a Panel widget with a keyboard shortcut. e.g. Meta key or Alt+F1 for Kickoff, or any other Panel widget using a custom shortcut, then close it by hitting that shortcut again. Afterwards, the window that previously had focus does not regain focus. As a result, any keyboard keys typed get handed to the now-closed widget, instead of the window. This is frequently mildly annoying. This works properly when KRunner itself is activated and closed using a keyboard shortcut.
*** Bug 454327 has been marked as a duplicate of this bug. ***
See also: https://invent.kde.org/plasma/plasma-workspace/-/commit/7dd5210c8766f4226c27afe5a4ef83ece6d15143
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/960
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1771
Git commit bad07cde1386575fa88bfd50a3ec2fa3dd2b1ee7 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:17. Pushed by ngraham into branch 'master'. shell: move keyboard focus code from frontend to backend It makes the code easier to be maintained across different platforms. Related: bug 352476 M +10 -10 shell/shellcorona.cpp https://invent.kde.org/plasma/plasma-workspace/commit/bad07cde1386575fa88bfd50a3ec2fa3dd2b1ee7
Git commit 3a16cbe7b01622ca1f6e045ddde7c7a61708f990 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:17. Pushed by ngraham into branch 'master'. shell/panelview: unfocus on the panel when clicking outside When the panel is focused, clicking outside should make the panel unfocused. Related: bug 352476 M +7 -0 shell/panelview.cpp https://invent.kde.org/plasma/plasma-workspace/commit/3a16cbe7b01622ca1f6e045ddde7c7a61708f990
Git commit d2057d7174975c4379266f48f987fbac967e8ef3 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:17. Pushed by ngraham into branch 'master'. shell/panelview: press shortcut to unfocus on the panel when it's in focused state The second time pressing Meta+Alt+P, the panel should be unfocused. Related: bug 352476 M +3 -0 shell/shellcorona.cpp https://invent.kde.org/plasma/plasma-workspace/commit/d2057d7174975c4379266f48f987fbac967e8ef3
Git commit c89fb19673e35fc50a42a114ad3e52a503c05098 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:17. Pushed by ngraham into branch 'master'. desktoppackage: don't focus on panel when pressing applet shortcuts The panel focus shortcut is Meta+Alt+P. This keeps the old behavior. Related: bug 352476 FIXED-IN: 5.25 M +0 -20 desktoppackage/contents/views/Panel.qml https://invent.kde.org/plasma/plasma-desktop/commit/c89fb19673e35fc50a42a114ad3e52a503c05098
Git commit 6eac53b6d0b19e46c28018434ff416ba144d0c1a by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:17. Pushed by ngraham into branch 'master'. shell/panelview: set passive status when pressing Escape key Related: bug 352476 M +8 -0 shell/panelview.cpp https://invent.kde.org/plasma/plasma-workspace/commit/6eac53b6d0b19e46c28018434ff416ba144d0c1a
Git commit 53fdac77ec442aa384f1df2be75934c76bb828ff by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:17. Pushed by ngraham into branch 'master'. shell/panelview: restore old window focus when panel loses focus Related: bug 352476 M +21 -0 shell/panelview.cpp M +10 -0 shell/panelview.h M +9 -0 shell/shellcorona.cpp M +4 -0 shell/shellcorona.h https://invent.kde.org/plasma/plasma-workspace/commit/53fdac77ec442aa384f1df2be75934c76bb828ff
Git commit e315dcd8cd6631a5d7030f437380e0ef6f51b6b6 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:36. Pushed by ngraham into branch 'Plasma/5.25'. desktoppackage: don't focus on panel when pressing applet shortcuts The panel focus shortcut is Meta+Alt+P. This keeps the old behavior. Related: bug 352476 FIXED-IN: 5.25 (cherry picked from commit c89fb19673e35fc50a42a114ad3e52a503c05098) M +0 -20 desktoppackage/contents/views/Panel.qml https://invent.kde.org/plasma/plasma-desktop/commit/e315dcd8cd6631a5d7030f437380e0ef6f51b6b6
Git commit 4eeb953bd7ceca4b3b76728abd8dffda2671ab36 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:37. Pushed by ngraham into branch 'Plasma/5.25'. shell/panelview: unfocus on the panel when clicking outside When the panel is focused, clicking outside should make the panel unfocused. Related: bug 352476 (cherry picked from commit 3a16cbe7b01622ca1f6e045ddde7c7a61708f990) M +7 -0 shell/panelview.cpp https://invent.kde.org/plasma/plasma-workspace/commit/4eeb953bd7ceca4b3b76728abd8dffda2671ab36
Git commit 7df9ad19f9b17e13febf07050e7dc54c85a2773b by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:37. Pushed by ngraham into branch 'Plasma/5.25'. shell/panelview: restore old window focus when panel loses focus Related: bug 352476 (cherry picked from commit 53fdac77ec442aa384f1df2be75934c76bb828ff) M +21 -0 shell/panelview.cpp M +10 -0 shell/panelview.h M +9 -0 shell/shellcorona.cpp M +4 -0 shell/shellcorona.h https://invent.kde.org/plasma/plasma-workspace/commit/7df9ad19f9b17e13febf07050e7dc54c85a2773b
Git commit 18cfb226fc8b56346d66eb51d84c1ed7fbdc53d3 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:37. Pushed by ngraham into branch 'Plasma/5.25'. shell: move keyboard focus code from frontend to backend It makes the code easier to be maintained across different platforms. Related: bug 352476 (cherry picked from commit bad07cde1386575fa88bfd50a3ec2fa3dd2b1ee7) M +10 -10 shell/shellcorona.cpp https://invent.kde.org/plasma/plasma-workspace/commit/18cfb226fc8b56346d66eb51d84c1ed7fbdc53d3
Git commit 74f54bced881b917f71189565ecc3aaab3cefe11 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:37. Pushed by ngraham into branch 'Plasma/5.25'. shell/panelview: set passive status when pressing Escape key Related: bug 352476 (cherry picked from commit 6eac53b6d0b19e46c28018434ff416ba144d0c1a) M +8 -0 shell/panelview.cpp https://invent.kde.org/plasma/plasma-workspace/commit/74f54bced881b917f71189565ecc3aaab3cefe11
Git commit 9e1cbb8ff214f8277a308c20760d03cf151667e1 by Nate Graham, on behalf of Fushan Wen. Committed on 30/05/2022 at 13:37. Pushed by ngraham into branch 'Plasma/5.25'. shell/panelview: press shortcut to unfocus on the panel when it's in focused state The second time pressing Meta+Alt+P, the panel should be unfocused. Related: bug 352476 (cherry picked from commit d2057d7174975c4379266f48f987fbac967e8ef3) M +3 -0 shell/shellcorona.cpp https://invent.kde.org/plasma/plasma-workspace/commit/9e1cbb8ff214f8277a308c20760d03cf151667e1
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1983
Git commit 07efee1095edfb2e27e06952ab83d9ddbe30098b by Fushan Wen. Committed on 20/08/2022 at 04:34. Pushed by fusionfuture into branch 'master'. shell: allow to cycle through multiple panels This adds `m_blockRestorePreviousWindow` to avoid restoring focus to the panel, and replace QHash with QMap to save panel orders. Related: bug 352476 M +1 -16 shell/panelview.cpp M +0 -7 shell/panelview.h M +94 -27 shell/shellcorona.cpp M +18 -2 shell/shellcorona.h https://invent.kde.org/plasma/plasma-workspace/commit/07efee1095edfb2e27e06952ab83d9ddbe30098b
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2133
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1152
Git commit 55a9eeba7595548e4e748d95a103813359639dff by Fushan Wen. Committed on 21/07/2023 at 18:12. Pushed by fusionfuture into branch 'master'. desktoppackage: activate panel on "Activate Panel Widget" shortcut pressed This partially reverts c89fb19673e35fc50a42a114ad3e52a503c05098 to bring back onActivated signal required by the global shortcut. Related: bug 455398, bug 352476 FIXED-IN: 5.26 M +11 -0 desktoppackage/contents/views/Panel.qml https://invent.kde.org/plasma/plasma-desktop/-/commit/55a9eeba7595548e4e748d95a103813359639dff
Git commit 648e10cea66926e93b52b9a7e0cc65b4055448e6 by Fushan Wen. Committed on 21/07/2023 at 19:03. Pushed by fusionfuture into branch 'Plasma/5.27'. desktoppackage: activate panel on "Activate Panel Widget" shortcut pressed This partially reverts c89fb196 to bring back onActivated signal required by the global shortcut. Related: bug 455398, bug 352476 FIXED-IN: 5.27 (cherry picked from commit 55a9eeba7595548e4e748d95a103813359639dff) M +12 -1 desktoppackage/contents/views/Panel.qml https://invent.kde.org/plasma/plasma-desktop/-/commit/648e10cea66926e93b52b9a7e0cc65b4055448e6
Git commit 2ae02766f8784fee5dcf33bfc6ae973e367beef1 by Fushan Wen. Committed on 21/07/2023 at 18:50. Pushed by fusionfuture into branch 'master'. shell: move `forceActiveFocus` to `PanelView` This allows to focus on the first child widget in a panel by setting containment status directly. This adds `savePreviousWindow()` to save the previously focused window, to be called in `PanelView::refreshStatus`. When the previous window is not reset, calling savePreviousWindow() will not do anything, so when there are more than one panel, it will not incorrectly save the wrong window (panel). Related: bug 455398, bug 352476 M +9 -0 shell/panelview.cpp M +14 -22 shell/shellcorona.cpp M +1 -0 shell/shellcorona.h https://invent.kde.org/plasma/plasma-workspace/-/commit/2ae02766f8784fee5dcf33bfc6ae973e367beef1
Git commit 6f0cd573dcc3634a453c8bb6b504013dc8372a95 by Fushan Wen. Committed on 21/07/2023 at 19:06. Pushed by fusionfuture into branch 'Plasma/5.27'. shell: move `forceActiveFocus` to `PanelView` This allows to focus on the first child widget in a panel by setting containment status directly. This adds `savePreviousWindow()` to save the previously focused window, to be called in `PanelView::refreshStatus`. When the previous window is not reset, calling savePreviousWindow() will not do anything, so when there are more than one panel, it will not incorrectly save the wrong window (panel). Related: bug 455398, bug 352476 (cherry picked from commit 2ae02766f8784fee5dcf33bfc6ae973e367beef1) M +9 -0 shell/panelview.cpp M +14 -22 shell/shellcorona.cpp M +1 -0 shell/shellcorona.h https://invent.kde.org/plasma/plasma-workspace/-/commit/6f0cd573dcc3634a453c8bb6b504013dc8372a95
Git commit 4509c349ad1a5a1f1c193d6b818f2cc6924747d2 by Akseli Lahtinen. Committed on 23/11/2023 at 14:59. Pushed by akselmo into branch 'master'. Show panel on wayland when focusing different panels When toggling focus between panels on wayland with Meta+Alt+P, it would break if one of the panels was hidden. Related: bug 473000 M +7 -3 shell/panelview.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/4509c349ad1a5a1f1c193d6b818f2cc6924747d2