Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window rule for CSD and/or Tiled state #951

Open
YaLTeR opened this issue Jan 9, 2025 · 0 comments
Open

Window rule for CSD and/or Tiled state #951

YaLTeR opened this issue Jan 9, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 9, 2025

Our prefer-no-csd flag is global and only applies to newly spawned applications. The reason for this is that many versions of SDL 2 shipped with a bug where if an xdg-decoration global is present at window creation but signals CSD preference, the window would never show up. So the way prefer-no-csd is implemented in niri is by straight up hiding the xdg-decoration global from all clients when it's off.

However, if the client already sees the xdg-decoration global, nothing prevents us from asking it to use CSD, so let's add a window rule like force-csd true for that. (prefer-no-csd combined with a blanket force-csd true rule will trigger the aforementioned SDL 2 bug, but we won't have that in the default config, so it's fine.)

The Tiled state is an entirely orthogonal concept from xdg-shell. Niri uses it together with prefer-no-csd because it makes GTK 4 and other clients square their rounded corners. It would also be useful to control that from a window rule, e.g. to switch from square-corner SSD to rounded-corner CSD for floating windows. Or to disable the Tiled state when prefer-no-csd is set for whatever reason. Something like tiled-state true/false.

Note that this prevents us from adding an is-tiled=true matcher so as not to introduce a window rule cycle. I think that a tiled state rule should be more useful than the tiled state matcher, so let's add the rule.

@YaLTeR YaLTeR added the enhancement New feature or request label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant