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

Steam window steals focus while opening

Open tapir opened this issue 9 years ago • 17 comments

1- User starts steam 2- Steam update phase kicks in 3- User does other stuff while waiting for update to finish 4- Steam switches to logging in phase and infuriates user by stealing the focus 5- User switches back to whatever he was doing 6- Steam window opens and steal backs the focus 7- User switches back to whatever he was doing 8- Steam ad window steals back the focus 9- User just wants to kill himself

tapir avatar Apr 04 '15 09:04 tapir

Handling of focus is done by the window manager. Steam does not set any special focus hints/flags on its login windows if I'm not mistaken, only on the chat and bottom-right notifications per user preference.

If your window manager doesn't let you change how it handles focus of new windows, you might want to switch to one that does. I use i3-gaps-next with my own modifications for focus-handling and placement.

ghost avatar Apr 19 '15 23:04 ghost

I use openbox, and also have the steam client stealing focus on start, both "stable" and beta steam clients steals focus upon startup.

My window manager (openbox) is configured to not set focus to newly opened windows, but do mouse-follow, and it actually works quite well on well-designed/implemented applications.

steps to reproduce:

  1. launch the steam client (i personnally start it from an xterm, so i can see the various stdout/stderr outputs).
  2. switch to another x11 window (i personally move my mouse to another xterm/app/monitor) ; newly selected window get the focus
  3. continue working in newly selected window, which has focus.
  4. the steam client opens up, and ... STEALS FOCUS

expected behaviour: my currently "selected"/used x11 window keeps the mouse focus

obtained behaviour: the steam client just steals focus ...

No option within the steam client allows me to change this steam clietn behaviour.

alemansec avatar Dec 21 '16 20:12 alemansec

Unfortunately with a backlog of 2K issues I'm very pessimistic about this issue ever getting fixed.

@mojangsta sorry for the year late response. It's not a window manager issue. This is a steam client-only problem.

tapir avatar Dec 22 '16 07:12 tapir

The claim that the window manager can stop Steam is bogus... I am running Cinnamon (and used to run Xfce) and neither of these WM's could stop Steam stealing focus. My current window handling settings in Cinnamon (3.2.7) are: Window Focus Mode: Mouse Automatically raise focused windows: OFF Bring windows which require attention to the current workspace: OFF Prevent focus stealing: ON

Those are pretty explicit options to stop focus stealing in many contexts but Steam still manages it, THREE times! rude

My updated details (since the problem is still present in what is quite a different setup since I first submitted this problem - I've shifted distribution and moved up a version on both the old one and the new one plus got a much newer kernel and been shifted to open source graphics drivers and changed window manager but this is still an issue!):

uname: 4.4.0-71-generic #92-Ubuntu SMP Fri Mar 24 12:59:01 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Steam client application Built: Mar 22 2017, at 23:45:04 Steam API: v017 Steam package version: 1490228413

Cinnnamon versions (latest for Linux Mint 18.1): cinnamon 3.2.7+serena cinnamon-common 3.2.7+serena cinnamon-control-center 3.2.1+serena cinnamon-control-center-data 3.2.1+serena cinnamon-desktop-data 3.2.4+serena cinnamon-I10n 3.2.2 cinnamon-screensaver 3.2.13+serena cinnamon-session 3.2.0+serena cinnamon-session-common 3.2.0+serena cinnamon-settings-daemon 3.2.1+serena cinnamon-themes 2016.12.07

P.S. I don't expect that this will be fixed (as with many other issues e.g. hugely dated libraries being used) and it's all the more reason to use better platforms like itch - it's just a pity that there are fewer professional dev's using others at the moment; though it will change in time as new dev's build themselves up on other more hospitable platforms.

PhoenixRiver avatar Mar 30 '17 16:03 PhoenixRiver

Still a pretty annoying issue. Launch a game using Steam, Steam decides to run an update, then it finishes the update a few minutes later and minimizes the game to ask if I want to restart Steam...

drudiger avatar Jul 06 '18 08:07 drudiger

It's been 3 years. Oh god please fix this issue and save our souls from rotting with rage. How hard can it be to disable a focus stealing window, how?

tapir avatar Mar 16 '19 18:03 tapir

Lol, @kisak-valve keeps closing new issues over the years as duplicates and referencing this one, so they're aware it still exists, but they just won't spend the time to fix it.

Also, I initially didn't realize this was the Steam for Linux repo (found this issue on Google), and I actually have the issue on the Windows client. Doesn't look like they have a repo for that one though.

drudiger avatar Mar 17 '19 06:03 drudiger

It's not just the main Steam window, the Friends window also steals focus repeatedly. While we have the current issues with connecting to the Friends network it is extra annoying - after you click 'RETRY CONNECTION' and try to go back to what you were doing the window will steal focus a few seconds later, then it will steal focus again when it fails to connect. This basically makes it very annoying to do anything else with your PC except click the button and wait.

robertc avatar Jul 07 '19 13:07 robertc

This continues to be an issue. especially during updates, where the update window pops up, then once you click it, two zenity windows, followed by the loading window, followed by the library and news, followed by chat. All of which steal focus. It is infuriating while trying to write code or type a message.

A-UNDERSCORE-D avatar Oct 07 '20 13:10 A-UNDERSCORE-D

Valve, get it together and fix this.

Augustin82 avatar Feb 06 '21 08:02 Augustin82

I would very much appreciate a fix for this issue too.

aseriesofdarkcaves avatar May 16 '21 11:05 aseriesofdarkcaves

Same

Cryotize avatar May 28 '21 20:05 Cryotize

Thought this was a bug in GNOME Shell or mutter when it happened during updates, which was not fun to try and troubleshoot. Steam is the only software on my system that steals focus like this.

Agree with the reasoning already stated here. Would appreciate a fix or a temporary DIY workaround; can give any information needed.

TheBoctor avatar Jul 21 '21 19:07 TheBoctor

Steam needs to forward to initial program-launch time, or the time of the interaction that caused a window to open to GTK, and relevant window managing protocols. Instead, by not forwarding the time, the window manager just has to take the current time as it is, breaking focus-stealing prevention. https://mail.gnome.org/archives/desktop-devel-list/2004-December/msg00306.html

tutacat avatar Dec 27 '21 13:12 tutacat

7 years later and Steam still STEALS FOCUS.

Zorrototo avatar Mar 01 '22 19:03 Zorrototo

fix this, Valve.

troububbles avatar Mar 10 '22 22:03 troububbles

Handling of focus is done by the window manager. Steam does not set any special focus hints/flags on its login windows if I'm not mistaken...

Okay, no, as a developer, I know this is BS. Whenever you go to create a window, there are always options relating to how a window presents itself. And, in fact, I remember one having to specifically go out of their way to make a window appear on top and steal focus. For instance, on Windows, there are API functions like BringWindowToTop and SetForegroundWindow.

So, in other words, Steam does this deliberately, with every single window. It's intentional. They haven't fixed it because they don't want to. We'll need to come up with our own fix/hack to prevent Steam from doing this.

AndrewDavis avatar Aug 08 '22 17:08 AndrewDavis

I have just made a dirty hack into the Ubuntu Desktop Environment to prevent most focus stealing issues (including Steam ones). However it involves modifying & recompiling system core libraries, so maybe too hard/dangerous for people lacking technical background. Have a try if you really hate focus stealing and could understand the hacking instructions. https://github.com/USN484259/persistent-focus

USN484259 avatar Aug 19 '22 14:08 USN484259

+1 for this. This is very annoying.

sedyh avatar Nov 17 '22 23:11 sedyh

Why is this still an issue? It shouldn't take this long to fix. I no longer let steam run in the background, and rarely use it unless I'm required for some sort of interaction. Please fix this.

CapricanDRJ avatar Jan 31 '23 21:01 CapricanDRJ

Oh, so not just me, then! Yes, agree with all of this - it's really, really annoying, no way to stop it happening and there are umpteen windows steals. I'm running XFCE on MX-Linux. Really hate the Steam client, it's horrible. Way too much crap in it.

Please fix the windows focus stealing!

junagu avatar Mar 12 '23 21:03 junagu

Bug: Client doesn't provide correct last interaction timestamp when opening new windows.

Issue transferred from https://github.com/ValveSoftware/steam-for-linux/issues/9783. @tutacat posted on 2023-07-03T12:41:29:

Your system information

  • Steam client version (build number or date): 1688171965 (Sat, Jul 1 1:19 AM UTC), but affects versions at least back to 2015
  • Distribution (e.g. Ubuntu): Fedora
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes
  • Steam Logs: steam-logs_1688171965_03072023.zip
  • GPU: AMD

Operating System Version:

  • "Fedora release 38 (Thirty Eight)" (64 bit)
  • Kernel Name: Linux
  • Kernel Version: 6.0.5-200.fc36.x86_64
  • X Server Vendor: The X.Org Foundation
  • X Server Release: 12201009 (XWayland)
  • X Window Manager: GNOME Shell
  • Steam Runtime Version: steam-runtime_0.20230509.49499

Video Card:

  • Driver: AMD AMD Radeon Graphics (renoir, LLVM 15.0.6, DRM 3.48, 6.0.5-200.fc36.x86_64)
  • Driver Version: 4.6 (Compatibility Profile) Mesa 22.3.3
  • OpenGL Version: 4.6
  • Desktop Color Depth: 24 bits per pixel
  • Monitor Refresh Rate: 59 Hz
  • VendorID: 0x1002
  • DeviceID: 0x1638
  • Revision Not Detected
  • Number of Monitors: 1
  • Number of Logical Video Cards: 1

Please describe your issue in as much detail as possible:

Expected: When a window is opened, the program passes the causal interaction timestamp (i.e. launch, click), to the window manager.

Behaviour: Interaction timestamp is not passed, and the current timestamp is used.

Steps for reproducing this issue:

  1. Launch Steam
  2. Either before the splash window, or before the library window is shown, click on, or type in, another open window than Steam.
  3. The new Steam window is focused, even if another interaction happened while Steam was loading.
  • The window manager is not passed the correct window-open timestamp (i.e. Steam launching), so it doesn't know whether the new window should be focused or not.

kisak-valve avatar Jul 03 '23 13:07 kisak-valve

@kisak-valve You have just referenced this issue once again from the now-closed issue #9783. Incidentally, this means that there have been literally 6000 issues since this one (#3783).

I believe that anyone would agree that this is a lot. It's been a long time now.

We'd all like to hear of any plan to solve the steal focus issue at last. Sometime before we get to issue #15783 maybe? Thanks for your time.

spacescientist avatar Jul 03 '23 15:07 spacescientist

This is VERY annoying issue, but to be fair if it is not fixed yet it is because this is very low priority due to the severeness of the issue.

Zorrototo avatar Jul 03 '23 21:07 Zorrototo

It seems that nowadays Steam client steals focus more frequently and aggressively. Sometimes the main window pops up for no reason when e.g. launching a game via taskbar icon. Today I've tried Steam client on a system without my hack above applied, the focus stealing IS SO FVCKING CRAZY and I cannot help thinking that if Valve ever have the concept of respect in their mind.

There are so many applications that steal focus on different OS platforms. Some are unintentional, some should blame the GUI toolkit, also there're OS's design flaws. However, Steam client is obviously INTENTIONAL considering its timing and frequency of focus stealing

Maybe They just consider this as work as expected and won't fix, but cannot say that for whatever reason.

I think their arrogance come from the fact that Steam is one of the top (if not the only) game platforms on Linux. So no matter how Valve nauseates you, you still have to buy games on it.

AFAIK, to solve the problem, you have multiple choices:

  1. Move to a game platform that works on Linux and won't steal focus which may not exist yet
  2. Develop a game platform that works on Linux and won't steal focus if you have time and money
  3. Move to other OS platform, voiding all your knowledge about Linux
  4. Stop playing computer games
  5. Hack the Steam program and being sued by Valve
  6. Hack the OS at the risk of crashing the whole system
  7. Give in and think that focus stealing is okay

Which will you choose ?

USN484259 avatar Jul 08 '23 11:07 USN484259

image I have found a setting in Xfce4 which you could disable focus stealing Go to Applications>Settings>Tune Window Manager>Focus>Turn on prevent focus stealing I have not tried this yet,but if it doesnt work i will delete this or Write under it that it doesnt work. :]

Admonito avatar Aug 01 '23 17:08 Admonito

It looks like after changing that setting made it not steal focus,but made the game unplayable for me due to lags and windows where still opening in the background (error windows and friend window) I recommed to use Kde plasma if you have problems with steam stealing focus,when useing kde plasma i have never had a focus stealing issue. :]

Admonito avatar Aug 01 '23 18:08 Admonito

Plasma had the issue.

//EDIT: since when are you using Plasma?

Zorrototo avatar Aug 01 '23 19:08 Zorrototo

Weird. 🤔

Admonito avatar Aug 01 '23 19:08 Admonito

Plasma had the issue.

//EDIT: since when are you using Plasma?

Around a month ago.

Admonito avatar Aug 01 '23 20:08 Admonito

The absolute state of closed-source software

awsms avatar Aug 04 '23 15:08 awsms