-
Notifications
You must be signed in to change notification settings - Fork 1.3k
enable server-side decorations for KDE/Plasma with Wayland #19949
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
base: master
Are you sure you want to change the base?
Conversation
On Gnome, client-side decoration with a custom titlebar allows for hiding titlebar when it is maximized, as per darktable-org#3315. But on Plasma, use SSD to give a themed titlebar, a window shadow, and a wide resize area. Fixes #darktable-org#19947 for Wayland/Plasma. Window resize area will require a different fix for Gnome, due to its use of CSD.
|
Why only for KDE/Plasma? |
Good question. As I understand it, Wayland gives window compositors two models:
32764b0 effectively switched darktable to using CSD on both Gnome and KDE. But it wasn't a complete CSD implementation. It didn't allow for a >1px window resize zone. It replaced the standard KDE theming from the titlebar with a chunky unstyled titlebar. My understanding is that this wasn't even to fix things under standard Gnome, but for particular Gnome extensions such as Unite. So this PR at least brings dt under KDE back to its prior SSD state, which gives workable decorations. The ideal fix could be to fully implement CSD for both Gnome and KDE. This means providing a resize drag area, potentially other niceties (shadows), and thinking carefully about what should actually be in the darktable titlebar. |
|
Reading more about this. The CSD/SSD paradigm seems to be a bit of a rift between Gnome and KDE, with no clear resolution. It would be possible to go all in on CSD (preferred by Gnome, allowed by KDE). The title bar could be customized to contain what is currently the top panel (darktable logo on left, view chooser on right) as well as (potentially) a close button. The title bar would then be hidden when needed by the This would be a more GNOME-ish behavior, and would lose the unified look which KDE gives to applications via SSD. Problems would be:
|
Test to see if we can use server-side decorations (SSD). Some Wayland display servers (e.g. Plasma/KWin) support both client-side (CSD) and server-side decorations for windows. Others (e.g. Gnome/Mutter) only support CSD. We can check for SSD support by querying the Wayland registery to see if xdg-decoration-unstable-v1 protocol is supported. X11, MacOS, and Windows support SSD, so if we are on a non-Wayland system we know we can use SSD.
Added another commit to address this. Instead of checking for KDE/Plasma/KWin, the code now does a more generic check for whether SSD windows are possible. In the case of non-Wayland, the answer is always yes. In the case of Wayland, it checks for xdg-decoration-unstable-v1 protocol, which implies SSD support. The result is that we should only use CSD for Gnome/Mutter. All other setups will have the benefits of SSD (>1px window resize region, titlebar which matches the desktop). Before this PR, we used CSD for Wayland regardless of whether SSD was available. Future work (beyond scope of this PR) would be to make CSD work better in Gnome (proper window resize areas) -- ideally so well that we use CSD for KWin as well. But it isn't there yet! |
|
Saw Windows build timed out. Don't know enough about it to understand why, though. |


On Plasma, use server-side decoration to give a themed titlebar, a window shadow, and a wide area for window resizing. Leave existing Gnome behavior: client-side decoration with a custom titlebar, which may allow for hiding titlebar when it is maximized, as per #3315.
Fixes #19947 for Wayland/Plasma. Unfortunately, there still needs to be a fix for a wider area for window resizing for Gnome.