Skip to content
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

Add KDE server-decoration support #410

Merged
merged 5 commits into from
Aug 24, 2022

Conversation

chrisduerr
Copy link
Contributor

This should add a very rough implementation of the server decoration protocol. I've tested it and it seems to work as far as I can tell. My priority was mostly to implement this for myself to force server-side decorations for GTK, this PR is more of an accident.

It's probably somewhat rough around the edges, especially since I'm not particularly familiar with all the wrappers like Global/Main/Resource etc, so please let me know if you have any suggestions for improvements.

@chrisduerr
Copy link
Contributor Author

Another thing I forgot: I'd like to hold off on the Anvil implementation until the API is signed-off on, just to prevent doing it twice.

@chrisduerr
Copy link
Contributor Author

I've already stated it on IRC, but I wanted to make it public here too: I currently don't plan on putting more effort into this PR, because this is basically only needed for GTK so working on the GTK patch would likely be more time-efficient.

That said, if someone else has more interest in this, feel free to clean it up. It should work as intended for anyone just trying to apply a temporary band-aid solution.

I'll leave it up to @Drakulix / @vberger if you want to keep this PR open or not. Probably going to be easier for people to find if it's still open.

@PolyMeilex
Copy link
Member

Speaking of GTK patch, if someone is dedicated enough to work on it, here is an MR: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2191 that can be used as a starting point (it works as is, but it needs some work to be merged). This solution would work for both GTK3 and GTK4.

I personally will not work on neither Smithay nor GTK solution, as GTK4 + libadwaita combo that will soonish become the main way of developing GTK apps, will not support SSD title bar anyway (as libadwaita window does not have title bar by default, it is added in app source code, and therefore we don't have control over it), maybe there is some way to design nice API for libadwaita to accommodate this, but I don't feel like working on it, especially because it reached 1.0 recently. So in libadwaita app enabling SSD would basically hide shadows and that's it, I'd rather respect it's CSD preference instead.

@chrisduerr
Copy link
Contributor Author

I personally will not work on neither Smithay nor GTK solution, as GTK4 + libadwaita combo that will soonish become the main way of developing GTK apps, will not support SSD title bar anyway

Do you know if it still supports hiding the controls for tiled/maximized windows somehow?

@chrisduerr chrisduerr force-pushed the kde_server_decoration branch from 8b1038b to e9529db Compare August 19, 2022 23:43
@chrisduerr
Copy link
Contributor Author

Rewrote everything from scratch to port my fork to 0.30.0. Since this forces a more standardized API, this PR might actually be mergeable now.

I don't plan to implement Anvil support, though it should be pretty trivial for someone else to do it if they're interested. But since this is basically just for legacy-support anyway I'm not sure if Anvil would want this.

This implements the KDE server decoration support with the new 0.30.0
trait-based syntax. Doing so makes it possible to support custom
decoration options for GTK applications.
@chrisduerr chrisduerr force-pushed the kde_server_decoration branch from e9529db to a05222d Compare August 19, 2022 23:53
@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2022

Codecov Report

Merging #410 (0aef0ee) into master (dff36d4) will decrease coverage by 0.12%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #410      +/-   ##
==========================================
- Coverage   30.21%   30.08%   -0.13%     
==========================================
  Files          94       96       +2     
  Lines       15007    15068      +61     
==========================================
- Hits         4534     4533       -1     
- Misses      10473    10535      +62     
Flag Coverage Δ
wlcs-core 27.66% <0.00%> (-0.12%) ⬇️
wlcs-output 10.61% <0.00%> (-0.05%) ⬇️
wlcs-pointer-input 29.72% <0.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/wayland/shell/kde/decoration.rs 0.00% <0.00%> (ø)
src/wayland/shell/kde/handlers.rs 0.00% <0.00%> (ø)
src/wayland/shell/mod.rs 0.00% <ø> (ø)
src/utils/geometry.rs 49.44% <0.00%> (-0.12%) ⬇️
src/backend/input/mod.rs 0.00% <0.00%> (ø)
src/backend/renderer/mod.rs 21.05% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chrisduerr chrisduerr requested review from PolyMeilex and i509VCB and removed request for PolyMeilex and i509VCB August 20, 2022 00:25
@chrisduerr chrisduerr requested review from i509VCB and removed request for PolyMeilex August 22, 2022 02:56
Copy link
Member

@PolyMeilex PolyMeilex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Drakulix Drakulix merged commit 09abc9f into Smithay:master Aug 24, 2022
@chrisduerr chrisduerr deleted the kde_server_decoration branch August 24, 2022 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants