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
Cleaner approach to decorations #1728
Comments
Nice write-up of the current situation, thanks for that. I think one use-case missing in the above list is people that want to *always* have full SSD decorations around the windows, even if they additionally use client side ones. Just throwing another random idea around: We do have the If action, we could add a query argument for the current SSD state, e.g. Something like: <!-- Use borders by default for non-csd views -->
<windowRule identifier="*">
<action name="If">
<query decorations="csd" />
<else>
<action name="SetDecorations" decorations="borders" />
</else>
</action>
</windowRule> or <!-- Use full decorations by default, even for CSD views -->
<windowRule identifier="*">
<action name="SetDecorations" decorations="full" />
</windowRule> |
Please add an option to preserve window size for |
The window size (the underlying client generated surface) should be kept (unless the window is snapped to some edge / region or maximized), so I assume you are referring to modifying the window size when changing the SSD decoration state? |
Yes. Preserve window's external dimensions. |
I believe the current approach to decorations is a bit messy and hard to extend. I tried to propose extensions in #1724 and #1725 with mixed success. If we want to avoid breaking changes in the future, I think it is better to think hard about the design first before merging any changes.
I am probably overthinking this. But now that the overthinking has already happened, I might as well share it.
Why is this complicated?
We cannot directly port concepts from openbox because Wayland distinguishes between client side decorations (CSD) and server side decorations (SSD).
The current situation
As of
ToggleDecoration
action is implemented,Decorate
andUndecorate
are not.<windowRule serverDecoration="">
<core><decoration>
<theme><keepBorder>
is implement, but behaves differently from openbox (and also from its documentation) (see Add keepBorder<theme>
option and enable it by default #876)ToggleDecorations
toggles between 'none' and 'full'Toggledecorations
cycles between 'border', 'none', and 'full'view->ssd_enabled
andview->ssd_titlebar_hidden
to track whether ssd and titlebar are enabledview->ssd
andview->ssd->titlebar.tree->node->enabled
to track whether ssd and titlebar actually exist. For example, full screen windows do not have decoration, even if it is enabled.has_ssd(view)
stores the result of the CSD/SSD negotiationWhat do we want?
As a start for discussion:
ToggleDecorations
andkeepBorder
.keepBorder
keepBorder=yes
, undecorated means 'borders'keepBorder=yes
, undecorated means 'none'<windowRule serverDecoration="server"> <action name="Undecorate"/>
(rule) orToggleDecorations
(interactive).ToggleDecorations
provides).Settings / Rules / Actions
Actions are more flexible than rules (because they can be used both in
<windowRole>
and<keybind>
/<mousebind>
) and rules are more flexible than settings (because different rules can apply to different windows). So if we add anything, I think we should prefer actions over rules and settings.Use cases
Which of these do we want to support?
disable CSD
manually toggle decorations
manually toggle between 'full' and 'none'
Only possible if
keepBorder
is disabled globally.manually toggle between 'full' and 'border'
Not currently possible
manually toggle between 'border' and 'none'
Not currently possible
manually switch to 'full'
Not currently possible
manually switch to 'border'
Not currently possible
manually switch to 'none'
Not currently possible
toggle between 'decorated' and 'undecorated' (whatever that means based on CSD/SSD negotation and
keepBorder
)Not currently possible
manually switch to 'decorated' (whatever that means based on CSD/SSD negotation and
keepBorder
)Not currently possible
manually switch to 'undecorated' (whatever that means based on CSD/SSD negotation and
keepBorder
)Not currently possible
disable titlebars
Not currently possible. It could look something like this:
hide titlebars on maximize
Not currently possible (except that borders are removed automatically). It could look something like this:
Proposals
ToggleDecorations
toggled between 'none' and 'full'. This does not cover any usecases involving 'border', but it is straight forward andDecorate
/Undecorate
could easily be added.<theme>
option and enable it by default #876. It adds basic support for 'border', but does not cover all use cases. it is also no longer clear whatDecorate
/Undecorate
should do.<theme>
option and enable it by default #876 did not have the 3-stateToggleDecorations
. Instead, it would toggle between 'full' and 'none' ifkeepBorder=no
and between 'full' and 'border' otherwise. This was changed because it would add non-removable borders to CSD windows.ToggleDecorations
/Decorate
/Undecorate
would manipulateview->ssd_enabled
, andToggleTitlebar
/ShowTitlebar
/HideTitlebar
would manipulateview->ssd_titlebar_hidden
. This would cover most use cases, but breaks backwards compatibility and was considered too low-level for end users.keepBorder
attributes to some actions to overwrite the global setting. It covers many use cases without breaking backwards compatibility, but has some weird edge cases.Decorate
/Undecorate
could use rules based onhas_ssd(view)
andkeepBorder
to decide what is the right thing to do. That would be an opinionated approach that intentionally does not cover all use cases.Some additional ideas that only cover specific use cases:
<action name="SetServerSideDecorationMode" mode="none|border|all"/>
.view->ssd_titlebar_hidden
. However, I would prefer to find a more generic solution.<windowRule>
could gain andecoration=server|client
attribute so that rules can be restricted to SSD or CSD windows.The text was updated successfully, but these errors were encountered: