sway/window: app_id on unfocused workspaces #2234
Merged
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.
This patch tries to make
app_id
specific styling fromsway/window
more useful if thesmart_borders
andsmart_gaps
Sway options are used in conjunction with theoffscreen-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 ifoffscreen-css
is enabled, the CSS class corresponding toapp_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 whenoffscreen-css
is set, but only if there is a single, non-floating window. This should catch situations wheresmart_borders
andsmart_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.