smithay
smithay copied to clipboard
Provide way to configure default decoration mode
KdeDecorationStateKdeDecorationState::new takes an argument for the default mode. XdgDecorationState::new doesn't take a default, and send_configure defaults to ClientSide if decoration_mode hasn't been set.
I think there should be a way to set the default decoration mode for XdgDecorationState. And also a way to change the default dynamically, which both protocols support. (A compositor may want to make this configurable in some way, and want to load configuration changes without a restart.)
Perhaps these types could be combined in some way, since a compositor is likely to want to provide both.
The initial idea for this was to just set mode in new_decoration handler, it is called directly on GetToplevelDecoration so before any decoration configure.
But I don't see any problem with adding the concept of default modes to the API.
Ah, I see, the new_decoration handler is a good place to deal with this. Other than being inconsistent with how the kde decoration protocol works.
For changing decoration mode dynamically, it would then be necessary to manually iterate over toplevels to set that. Which works. But the KDE decoration implementation doesn't seem to provide any way to do that. While the protocol spec notes "The server may change the default mode at any time.".