Skip to content

steamcompmgr: inherit the appID from windows sharing a steam_app_ class - #2485

Open
matte-schwartz wants to merge 1 commit into
ValveSoftware:masterfrom
matte-schwartz:focus-inherit-appid-wm-class
Open

matte-schwartz wants to merge 1 commit into
ValveSoftware:masterfrom
matte-schwartz:focus-inherit-appid-wm-class

Conversation

@matte-schwartz

Copy link
Copy Markdown
Collaborator

Under Steam focus control a window without STEAM_GAME is never eligible. Games spawned through the Flatpak portal escape Steam's pid tracking, and launcher-side stamping can miss a window that maps right after its process spawns. A launcher's windows then carry the stamp while the game's do not, and the launcher keeps focus.

Proton classes every window it creates steam_app_. That id is not the appID Steam stamps for non-Steam titles, so the class only serves as a key, and it is assumed unique per running game. An inherited window behaves as if Steam had stamped it, so it also keys PerAppId virtual connectors and a launcher and its game share one.

Closes: #1341

Under Steam focus control a window is only eligible once it has an appID,
from STEAM_GAME or from its process' cgroup or reaper. Games spawned
through the Flatpak portal escape Steam's pid tracking, so umu stamps
STEAM_GAME on Wine windows as they are created. Most of those are helpers
that never map, and gamescope only reads STEAM_GAME at map, so the stamps
are lost. A game window the stamping missed stays ineligible and the
launcher keeps focus.

Proton classes every window it creates steam_app_<SteamAppId>, and current
Steam sets that id to the reaper's appID, shortcuts included. A window
without an appID now inherits one from a window of the same class, and
windows are watched for STEAM_GAME and WM_CLASS from creation until they
first map. The class is assumed unique per running game. An inherited
window behaves as if Steam had stamped it, so it also keys PerAppId
virtual connectors and a launcher and its game share one.

Closes: ValveSoftware#1341
@matte-schwartz
matte-schwartz force-pushed the focus-inherit-appid-wm-class branch from 61dbb14 to 389d067 Compare October 20, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Game is not visible in SteamOS gamescope session when using Steam Runtime in Flatpak

1 participant