WaylandBackend: re-send app_id and title after the toplevel is unmapped - #2447
Open
gonzalezerik wants to merge 1 commit into
Open
gonzalezerik wants to merge 1 commit into
gonzalezerik wants to merge 1 commit into
Conversation
When the connector goes invisible, the toplevel is unmapped by attaching a NULL buffer. xdg_toplevel discards all of its attributes on unmap, so when it maps again it has no app_id, and no title unless the app's title changed meanwhile, since libdecor skips a title it has already sent. On compositors that reset the toplevel as the spec says (wlroots- and Smithay-based ones), window rules matching app_id "gamescope" stop applying to the remapped window. Send both again in the configure that follows the unmap, before the toplevel maps. Closes: ValveSoftware#2446
Collaborator
|
Since the app_id is only set in the configure callback, the compositor has already handled the initial commit without it, so rules that only apply when a window opens might still miss it. Could you re-send app_id and title right after the unmap instead? The icon gets dropped there too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2446.
When the connector goes invisible,
CWaylandPlane::Present()unmaps the toplevel by attaching a NULL buffer. xdg-shell discards all toplevel attributes on unmap ("The xdg_toplevel returns to the state it had right after xdg_surface.get_toplevel"), so the remapped window has no app_id, and no title unless the app's title changed in the meantime, becauselibdecor_frame_set_title()skips a title it has already sent.This re-sends both in
LibDecor_Frame_Configure()whenm_bUnmappedAwaitingConfigureis set, so they go out in the configure that follows the unmap, before the next buffer attach maps the toplevel. That's the spot @nilsenist pointed to in #2446. The title goes throughxdg_toplevel_set_title()directly since libdecor would skip it.Testing, nested in niri (Smithay resets the toplevel on unmap the same way wlroots does), RTX 5070 Ti, Flatpak Steam, Ghost of Tsushima launched with
gamescope -W 5120 -H 2160 -r 165 -f --hdr-enabled -- %command%:Before: after the startup unmap the window came back with no app_id, so a window rule on app_id
gamescopestopped applying.After: the window keeps app_id
gamescopeand the rule applies.Built with the Flathub
org.freedesktop.Platform.VulkanLayer.gamescope26.08 manifest on 3.16.31 (current master, 6867f50), together with an unrelated local patch to the HDR metadata path. No new warnings at the project'swarning_level=2.