Bug 422841 - OSD causes window focus to briefly change
Summary: OSD causes window focus to briefly change
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.18.5
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on: 448480
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-11 19:23 UTC by John Tanner
Modified: 2024-12-04 19:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Short video showing bug. (1001.88 KB, video/x-matroska)
2020-06-11 19:23 UTC, John Tanner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Tanner 2020-06-11 19:23:33 UTC
Created attachment 129241 [details]
Short video showing bug.

SUMMARY

When using media keys (e.g. volume and brightness) the OSD which indicates the change in the particular item briefly seizes focus from the widow which had focus immediately prior to the key being pressed. This causes the window from whom fucus has been grabbed to "flash" briefly. 

STEPS TO REPRODUCE
1. Open any window
2. Press a key which activates the OSD (for brightness or volume for example)
3. The window briefly loses focus and flashes.

OBSERVED RESULT

OSD activation causes active window to lose focus. 


EXPECTED RESULT

OSD should not grab focus from active window, even if the amount of time it is grabbed in small. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 20.04
(available in About System)
KDE Plasma Version: 5.18.14
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION

Short video attached to show specific issue.
Comment 1 John Tanner 2020-06-12 10:08:35 UTC
Present in:

KDE Plasma Version: 5.18.15
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Comment 2 Nate Graham 2020-06-12 16:12:01 UTC
Cannot reproduce with git master version of KWin.
Comment 3 Emmanuel Vasilakis 2021-12-19 06:49:11 UTC
Hi!

Can confirm that I'm seeing this in:

Operating System: Gentoo Linux
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.10.76-gentoo-r1 (64-bit)
Graphics Platform: Wayland
Processors: 6 × AMD Ryzen 5 4500U with Radeon Graphics
Memory: 7.3 GiB of RAM
Graphics Processor: AMD RENOIR

It is especially a problem when switching keyboard layout, since the window I'm typing in will lose focus to the osd, and have to wait for it to dissapear before resuming typing.
Comment 4 Emmanuel Vasilakis 2021-12-19 06:54:01 UTC
Also, this was not there before the update to 5.23 (i.e. 5.22).
Comment 5 Emmanuel Vasilakis 2021-12-19 08:09:39 UTC
Another point, it does not happen if running plasma in an X11 session, only in Wayland, same versions of everything.
Comment 6 Emmanuel Vasilakis 2021-12-19 08:11:43 UTC
(Last comment, I promise - can't find a way to edit previous ones).

The OSD also popups on the middle of the display, instead of the lower bottom of the screen, which might indicate that plasma/kwin is handling it as a window.
Comment 7 Emmanuel Vasilakis 2021-12-20 17:13:56 UTC
Might be duplicate of https://bugs.kde.org/show_bug.cgi?id=428859
Comment 8 Natalie Clarius 2021-12-21 23:41:32 UTC
It's not just Wayland, I'm having the same issue on X11. Plasma 5.23.4 with Framework 5.88.0 on Arch, and didn't have the problem before 5.23 iirc.
Comment 9 Natalie Clarius 2021-12-21 23:42:34 UTC
The OSD pops up in the right place for me though.
Comment 10 Vlad Zahorodnii 2022-01-11 13:23:10 UTC
The underlying problem is that plasma uses xdg-toplevel surfaces for OSDs. However, plasma gives OSDs their role too late, which creates this corner case. This bug will be fixed once plasma is fully ported to the layer-shell protocol. With that, kwin will be able to determine whether to give focus correctly.
Comment 11 Nate Graham 2022-01-11 14:48:29 UTC
Do we have a "Port Plasma to layer-shell" bug report or GitLab Issue?
Comment 12 Vlad Zahorodnii 2022-01-12 13:41:10 UTC
(In reply to Nate Graham from comment #11)
> Do we have a "Port Plasma to layer-shell" bug report or GitLab Issue?

I don't think so.
Comment 13 Nate Graham 2022-01-14 17:12:07 UTC
OK, I filed one and marked it as a blocker for this. That way the issue reported here won't get forgotten about once we do port to layer_shell.