steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

New Steam UI notifications steal focus on Wayland

Open ErikReider opened this issue 1 year ago • 25 comments

Your system information

  • Steam client version (build number or date): 1683078372
  • Distribution (e.g. Ubuntu): Fedora 38
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes

Steps for reproducing this issue:

  1. Focus any input field in any application
  2. Wait until notification pops up
  3. The notification steals the focus

I'm definitely not an X11 ATOM expert but when running a xprop on the notifications, the WM_TAKE_FOCUS ATOM is in-use.

On the topic of notifications, providing a toggle in the settings to use the system notification daemon would be nice. Would make it easier to dismiss and control where notifications appear :)

ErikReider avatar May 04 '23 19:05 ErikReider

Any updates on this?

raidenovich avatar May 14 '23 19:05 raidenovich

This is very annoying... specially when you are in the middle of writting some text but a chain of notifications suddently come up and interrupt you mid-typing.

Using sway, I tried to retrieve the information from the window to at least be able to capture it and remove its focus in the configuration of the window manager. But for some reason I was unsuccessful, since it looks like I can't properly select the notification window for some reason.

Has anyone at least been able to get some details that can be used to filter the window out? such as the window class / role?

Ferk avatar May 29 '23 12:05 Ferk

This bug has still not been fixed in the recent stable release and it is happening as I type this comment.

I think for most Wayland WMs there's some way to make it so that it never get focused and rendered as an overlay layer.

I have tested Hyprland aswell and it has the same problem as Sway. GNOME on Wayland doesn't seem to have any of these issues, though.

raidenovich avatar Jun 15 '23 11:06 raidenovich

Still present and not exclusive to Wayland, it is happening on X too.

According to window manager logs, Steam spawns a stray window with title = "None" and kills it 20 ms later.

This is extremely annoying, it steals focus and shifts all windows on any tiling window manager.

I attempted to make floating window and group rules as a workaround, but for some reason, Qtile could not match name="None" even by itself.

The logs don't reveal the instance or class, so the (empty) title is all that can be used to try and filter it--hopefully successfully.


Edit: With my nasty hack of doing while true; do xprop -name None; done, I was able to find a bit more information:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x3200347
  Serial number of failed request:  567
  Current serial number in output stream:  567

purplebar0 avatar Jun 16 '23 12:06 purplebar0

It also happens on X with XFWM (stacking window manager), although it sometimes just stops happening too. Haven't found a reliable way to reproduce it.

Most often it occurs after launching Steam. As @purplebar0 pointed out, the notification that's disappearing and spawning said error in the log, steals the focus temporarily. However, even though the previous focused window receives focus again, it isn't actually received "completely". What I mean by this, is despite you thinking the window has focus, you won't be able to type anything in said window without first alt-tabbing to a Steam-owned process, then tabbing back again. This can be annoying if you're working in a text-editor for instance, since suddenly you won't be able to input anything until you've tabbed in and out. And this is necessary every time a notification disappears

This started happening after the beta got pushed to the stable branch. It wasn't always an issue with the beta. Or maybe it was and I just got lucky for not having encountered it, seeing it doesn't always happen

JacobSvenningsen avatar Jun 18 '23 07:06 JacobSvenningsen

However, even though the previous focused window receives focus again, it isn't actually received "completely".

What I mean by this, is despite you thinking the window has focus, you won't be able to type anything in said window without first alt-tabbing to a Steam-owned process, then tabbing back again.

This is part of a different issue which can be reproduced by switching back and forth from the Chat window, where the text field remains active after switching from the Chat window.

On 18 June 2023 07:05:00 UTC, "Hu - notifications at github.com" @.***> wrote:

It also happens on X with XFWM (stacking window manager), although it sometimes just stops happening too. Haven't found a reliable way to reproduce it.

Most often it occurs after launching Steam. As @purplebar0 pointed out, the notification that's disappearing and spawning said error in the log, steals the focus temporarily. However, even though the previous focused window receives focus again, it isn't actually received "completely". What I mean by this, is despite you thinking the window has focus, you won't be able to type anything in said window without first alt-tabbing to a Steam-owned process, then tabbing back again. This can be annoying if you're working in a text-editor for instance, since suddenly you won't be able to input anything until you've tabbed in and out. And this is necessary every time a notification disappears

This started happening after the beta got pushed to the stable branch. It wasn't always an issue with the beta. Or maybe it was and I just got lucky for not having encountered it, seeing it doesn't always happen

-- Reply to this email directly or view it on GitHub: https://github.com/ValveSoftware/steam-for-linux/issues/9458#issuecomment-1595998934 You are receiving this because you were mentioned.

Message ID: @.***>

purplebar0 avatar Jun 18 '23 08:06 purplebar0

Update: This does not only affect notifications, but any windows that are to be closed. Tested with the Steam Settings window.

On Qtile + Picom, it is super annoying even on Max layout because ~~smooth window transitions~~ (edit: even with no animations!) have to display that stray invisible window and it ends up being a flashing window.

purplebar0 avatar Jun 25 '23 21:06 purplebar0

If you run with this environment variable set do those windows go away for you:

STEAM_DISABLE_BROWSER_SHUTDOWN_WORKAROUND=1 steam

lostgoat avatar Jun 29 '23 20:06 lostgoat

If you run with this environment variable set do those windows go away for you:

STEAM_DISABLE_BROWSER_SHUTDOWN_WORKAROUND=1 steam

Yes! The windows don't instantly close, but at least the annoying side-effect of the workaround isn't present any longer.

purplebar0 avatar Jun 29 '23 21:06 purplebar0

Just to confirm, does the env fix both the flashing and the focus issue, or just one of them?

lostgoat avatar Jun 29 '23 23:06 lostgoat

Can't confirm. Never had the flashing issue, and the env var doesn't fix the focus issue either. Using sway, fwiw

Sid127 avatar Jun 30 '23 08:06 Sid127

Just to confirm, does the env fix both the flashing and the focus issue, or just one of them?

I can confirm that it fixes both in my case (Qtile WM).

purplebar0 avatar Jun 30 '23 08:06 purplebar0

Using an AMD GPU, I can confirm that today's beta disables the workaround without requiring the environment variable.

purplebar0 avatar Jul 06 '23 08:07 purplebar0

Using an AMD GPU, I can confirm that today's beta disables the workaround without requiring the environment variable.

Still an issue for me on sway. Haven't tried the env variable though

ErikReider avatar Jul 06 '23 16:07 ErikReider

I'm using Sway too, the issue is not fixed for me in the latest beta and the environment variable doesn't seem to help either.

Bettehem avatar Jul 07 '23 18:07 Bettehem

I am on bspwm on X and still have this issue. The env variable seemed to work.

InventorXtreme avatar Jul 10 '23 22:07 InventorXtreme

As a workaround for sway, has had any success with no_focus? I'm trying no_focus [class="steam"] right now, but I con't confirm it works yet.

DrymarchonShaun avatar Jul 23 '23 05:07 DrymarchonShaun

Update to my previous comment - as far as I can tell, it works well enough for a temporary solution. I have noticed some weirdness potentially caused by the workaround, but haven't had enough time to know if they are consistently occurring.

DrymarchonShaun avatar Jul 25 '23 04:07 DrymarchonShaun

no_focus [class="steam"] didn't make any difference to me, and notifications still block focus :disappointed: ... I'm just disabling notifications in steam instead, but I reenabled them to test if the no_focus works.

SuperTux88 avatar Jul 26 '23 18:07 SuperTux88

This seems to be fixed in the current steam client

Sid127 avatar Sep 02 '23 16:09 Sid127

I'm still having this issue with the Steam Client Beta, using KDE on X. Seems to be related to #9716

J-Lowrance avatar Sep 18 '23 23:09 J-Lowrance

Having this issue on i3wm with steam version 1696019606 (on nvidia)

ibrokemypie avatar Oct 01 '23 07:10 ibrokemypie

Oddly this same thing happened to me when I used X11. When I switched to Wayland, it didn't do it anymore, but recently I upgraded to Ubuntu 23.10 and it now does this on Wayland. I haven't tested X11 since I upgraded, so I don't know if it still does it there anymore.

EDIT: Tested, still happens on X11.

MisterSheeple avatar Oct 15 '23 03:10 MisterSheeple

Fixed for me by adding following rule to my hypr.conf:

windowrulev2 = noinitialfocus, title:(^notificationtoasts.*)

JangXa avatar Jan 13 '24 22:01 JangXa

Fixed for me by adding following rule to my hypr.conf:

windowrulev2 = noinitialfocus, title:(^notificationtoasts.*)

Sadly I can't confirm this working.

Chais avatar Feb 18 '24 07:02 Chais