Bug 482653 - Standalone Keyboard Layout widget inappropriately transfers focus to its parent Panel when activated
Summary: Standalone Keyboard Layout widget inappropriately transfers focus to its pare...
Status: RESOLVED DUPLICATE of bug 479084
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 6.0.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression, usability
Depends on:
Blocks:
 
Reported: 2024-03-07 07:12 UTC by Alexey
Modified: 2024-03-19 18:51 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.2


Attachments
demo (806.05 KB, video/mp4)
2024-03-07 07:12 UTC, Alexey
Details
keyboard settings (74.92 KB, image/png)
2024-03-07 13:49 UTC, Alexey
Details
remove-onActivated.patch (1.01 KB, text/plain)
2024-03-18 19:57 UTC, Hanabishi
Details
demo-6.0.2.mp4 (127.17 KB, video/mp4)
2024-03-18 23:04 UTC, Hanabishi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2024-03-07 07:12:26 UTC
Created attachment 166547 [details]
demo

STEPS TO REPRODUCE
1. Add some keyboard layouts;
2. Add keyboard layout widget / system tray entry;
3. Switch layout with shortcut / click on widget;

OBSERVED RESULT

Switching keyboard layout leads to Application launcher focus/unfocus.

EXPECTED RESULT

Switching keyboard layout just switches keyboard layout.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Comment 1 Vlad Zahorodnii 2024-03-07 13:37:04 UTC
Cannot reproduce
Comment 2 Alexey 2024-03-07 13:46:11 UTC
(In reply to Vlad Zahorodnii from comment #1)
> Cannot reproduce

Did you add the Keyboard layout widget?
Maybe you need to reboot your system, because sometimes this is not reproducible for some reason.
Comment 3 Alexey 2024-03-07 13:49:17 UTC
Created attachment 166586 [details]
keyboard settings

Added keyboard settings to attachments.
Comment 4 Vlad Zahorodnii 2024-03-07 13:51:02 UTC
Yes, I have it
Comment 5 Alexey 2024-03-07 14:09:10 UTC
It looks like the bug belongs to the 'plasmashell' product and the 'Keyboard Layout' component, but I don't see this component when editing the bug report.
Comment 6 Nate Graham 2024-03-07 21:27:41 UTC
Are you using X11 or Wayland? Does it happen in both, or just one?
Comment 7 Roman 2024-03-07 22:38:16 UTC
New info:
This problem will be solved if you remove the keyboard layout widget from the tray.
That exist in both modes (X11/wayland)
Comment 8 Roman 2024-03-07 22:47:17 UTC
New info[2]:
Если добавить показ раскладки в СИСТЕМНЫЙ ЛОТОК на панели, баг не проявляется.
Только если как отдельный виджет, тогда она проявляется.
Comment 9 Alexey 2024-03-08 05:26:47 UTC
(In reply to Roman from comment #7)
> New info:
> This problem will be solved if you remove the keyboard layout widget from
> the tray.
> That exist in both modes (X11/wayland)

Yes, but temporary; after reboot the issue restores.
Comment 10 Alexey 2024-03-08 05:32:11 UTC
(In reply to Roman from comment #8)
> New info[2]:
> If you add display of the layout to the SYSTEM TRAY on the panel, the bug does not appear.
> Only if it is a separate widget, then it appears.

Yes, it looks like the issue only applies to the widget position of the Keyboard layout component.
Comment 11 Nate Graham 2024-03-08 22:46:08 UTC
Can reproduce the issue with a separate Keyboard Layout widget. I suspect it's the same problem as
Comment 12 Nate Graham 2024-03-08 22:46:55 UTC
*** Bug 482058 has been marked as a duplicate of this bug. ***
Comment 13 Vladislav 2024-03-09 17:24:17 UTC
Same for me, reproduces even with `qdbus org.kde.keyboard /Layouts org.kde.KeyboardLayouts.switchToNextLayout` and `org.kde.KeyboardLayouts.setLayout`
Comment 14 Bug Janitor Service 2024-03-10 21:26:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2110
Comment 15 Nate Graham 2024-03-11 17:56:45 UTC
Git commit 5909ac488df5fa469174387be4bb1ffe23578d0a by Nate Graham, on behalf of Niccolò Venerandi.
Committed on 11/03/2024 at 17:56.
Pushed by ngraham into branch 'master'.

Panel: Don't take keyboard focus when one of its widgets is activated

This re-introduces the workaround that was removed by Marco in `6a61a56bcd`
Related: bug 479084
FIXED-IN: 6.0.2

M  +4    -1    desktoppackage/contents/views/Panel.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/5909ac488df5fa469174387be4bb1ffe23578d0a
Comment 16 Nate Graham 2024-03-11 18:07:10 UTC
Git commit a98f5f84098723a8c0dffeeb4de75f6f240a3671 by Nate Graham, on behalf of Niccolò Venerandi.
Committed on 11/03/2024 at 17:57.
Pushed by ngraham into branch 'Plasma/6.0'.

Panel: Don't take keyboard focus when one of its widgets is activated

This re-introduces the workaround that was removed by Marco in `6a61a56bcd`
Related: bug 479084
FIXED-IN: 6.0.2


(cherry picked from commit 5909ac488df5fa469174387be4bb1ffe23578d0a)

3bfe5033 Do not give panel keyboard focus when an applet is activated

M  +4    -1    desktoppackage/contents/views/Panel.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/a98f5f84098723a8c0dffeeb4de75f6f240a3671
Comment 17 Nate Graham 2024-03-11 19:44:19 UTC
*** Bug 483235 has been marked as a duplicate of this bug. ***
Comment 18 Artem Vorotilin 2024-03-17 18:25:26 UTC
On plasma 6.0.2 the problem is still observed.
Comment 19 Nate Graham 2024-03-18 18:55:47 UTC
Cannot reproduce; it's now completely fixed for me on Wayland, and there's no reason why the change in question shouldn't have fixed it.

This means you may not actually be experiencing the exact same bug, but rather a different one. Please submit a new bug report for it so we can investigate it separately. Thanks.
Comment 20 Hanabishi 2024-03-18 19:33:12 UTC
100% can still reproduce it on 6.0.2. I continue to use my patch from Bug 482058 as a workaround.
Comment 21 Nate Graham 2024-03-18 19:40:21 UTC
Please attach a screen recording that shows the issue happening to you on Plasma 6.0.2.
Comment 22 Hanabishi 2024-03-18 19:57:55 UTC
Created attachment 167425 [details]
remove-onActivated.patch

It's exactly the same as on the video above.

In fact I just tried to remove that "fixed" function completely (the patch is attached). Funny enough, no changes in behavior whatsoever. So the issue is outside of that function.
Comment 23 Hanabishi 2024-03-18 20:12:47 UTC
(In reply to Hanabishi from comment #22)
> Funny enough, no changes in behavior whatsoever.

Actually no, the behavior has changed. It only grabs the focus now, but does not bring it back on the next layout switch. So it is partially involved.
Comment 24 Nate Graham 2024-03-18 22:06:18 UTC
Please attach a screen recording that shows the issue happening to you on Plasma 6.0.2, as I asked. Without that I can't proceed here.
Comment 25 Hanabishi 2024-03-18 23:04:57 UTC
Created attachment 167436 [details]
demo-6.0.2.mp4

Idk how it will help (is this a sanity check?), but here it is.
I even created a fresh new user to be sure this is not a weird configuration issue.
Comment 26 Yehor 2024-03-19 10:08:05 UTC
Can confirm that plasma 6.0.2 still has this issue (X11 session).
Comment 27 Nate Graham 2024-03-19 18:50:41 UTC
Indeed, we have multiple reports of this still happening, even though I can't reproduce it. Marking as a duplicate of Bug 479084, which we'll use as the master bug, since the issues with all these widgets have a common root cause.

*** This bug has been marked as a duplicate of bug 479084 ***