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

sway/window: app_id on unfocused workspaces #2234

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

kris7t
Copy link
Contributor

@kris7t kris7t commented Jun 13, 2023

This patch tries to make app_id specific styling from sway/window more useful if the smart_borders and smart_gaps Sway options are used in conjunction with the offscreen-css option of the module.

My main use case for this is styles like window#waybar.solo.kitty, which can make Waybar blend in with the solo window on the workspace (gapless and borderless thanks to the Sway options). For example, you may set a semi-transparent background for Waybar only if a terminal with semi-transparent background is the only window on the workspace, but use a fully opaque background for any other (opaque) window.

Unfortunately, app_id-specific styling is not very useful with multiple monitors. Even if offscreen-css is enabled, the CSS class corresponding to app_id is only applied for the focused window. Thus, Waybar can only ever blends with focused windows.

This patch also applies the app_id for unfocused workspaces when offscreen-css is set, but only if there is a single, non-floating window. This should catch situations where smart_borders and smart_gaps are useful. Technically, gaps and borders are collapsed also when the workspace itself is set to tabbed/stacking with multiple windows, but in that case titlebars (for tabs/stacks) are always present, which would prevent the bar from seamlessly blending in with the visible window anyways.

Since this changes established behavior and might break some configs, a more prudent alternative approach would be to add another configuration option to be used in conjunction with offscreen-css to enable this behavior.

If the unfocused workspace has a single window, use window-specific
styling when offscreen-css is enabled.
@Alexays Alexays merged commit 52a8b1d into Alexays:master Jul 18, 2023
@Alexays
Copy link
Owner

Alexays commented Jul 18, 2023

Thanks!

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.

None yet

2 participants