Toggling server decorations on and off for an existing window
According to zxdg_decoration_manager_v1
the final mode of the window decorations is decided by the compositor, that enforces it's desired mode. However it's sometimes needed to turn off decorations entirely. It's currently possible to return to client-side decoration mode by destroying zxdg_toplevel_decoration_v1
object, but it seems that there is no way to turn it back:
Creating an xdg_toplevel_decoration from an xdg_toplevel which has a buffer attached or committed is a client error, and any attempts by a client to attach or manipulate a buffer prior to the first xdg_toplevel_decoration.configure event must also be treated as errors.
So if client wants to completely disable decorations and then re-enable them, it can't be done with server decorations at all. That scenario is supported by client decoration mode (client renders decorations as it sees fit), KWin's server_decoration
protocol (the client can switch the decoration mode as it sees fit), X11 (client just sets the appropriate properties), Win32 API and Cocoa.
There is another scenario where app developer wants to play by DE's rules and announces support for server decorations, but still leaves the final decision to the app user and provides an option in settings dialog to toggle server decorations on and off.