-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
wayland: Add experimental pantheon-desktop-shell protocol #1705
Conversation
1ace76a
to
fb79b16
Compare
Opened https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3092 to be able to remove the horrible hack with next Mutter version 🤞 |
602d696
to
f9d227c
Compare
We now require this to be merged https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3298 I'll try to add it in 45.1 |
f9d227c
to
4d3179d
Compare
With the above MR merged and applied, the protocol should now work 🙂 One should just implement the details where there is a |
Here is a patched mutter for jammy if someone want to experiment https://code.launchpad.net/~elementary-os/+archive/ubuntu/staging/+build/26741251 otherwise we will have it working OOTB in mutter 45.1 (note that it will soft-fail so it doesn't need to be rebuilt against the patched mutter) |
I have 3 main interfaces available here:
|
I'm not sure if it's relevant here but it would be nice to have some kind of shell-modal hint like for example the shut down dialog or Polkit dialogs which would be always on top, "sticky", and ideally we could do something like dim and/or blur the desktop behind them. And I think also these dialogs probably should be always centered and shouldn't be able to be moved maybe |
Before we set in anything here, i think, we should try to implement the client-side part to known what is possible to do, given limitations in the Gtk side.
is there any other use case than the screenshot app for the extended_behavior surface? when we make the screenshot app a portal, the stick behaviour will be lost anyway. Also, i think we still need a "bubble" interface for the notifications bubbles.
Maybe we could do some fancy interpretation of the proposed xdg_dialog interface upstream? like, a non-parented xdg_toplevel with a xdg_dialog surface represents a system dialog. I don't think there's something in their documentation that won't allow this behaviour. |
Maybe I understood the |
I think that the notification bubbles should be shipped with Gala and should be using Meta.WaylandClient and be placed by Gala. I can see the allways-on-top behavior be used by the Shutdown menu and the Welcome screen. |
Yeah I'm open to any other wording, here is how the KDE protocol is doing this https://wayland.app/protocols/kde-plasma-shell#org_kde_plasma_surface:request:set_panel_behavior |
Here is the implementation for the stays-on-top behavior in Screenshot elementary/screenshot#275 |
This currently doesn't seem to work on OS 8?
Btw the reason for the build failing is the documentation. It complains about Pantheon and Desktop symbols not being found but adding |
6701c3d
to
f4935ee
Compare
Why not use layer-shell for this? |
Good point for layer-shell, we might still need a custom protocol for the "sticky" behavior |
In KDE, we moved away from a custom protocol to wlr-layer-shell, and that has been reasonably good to us. |
IIRC, we can't use layer-shell because of gtk4 not supporting custom surfaces. So we need protocols that enhances a xdg_toplevel surface instead so we can keep moving alway from gtk3. |
Isn't that what a |
Ah, there's a layer-shell library for GTK 4 written by @wmww: https://github.com/wmww/gtk4-layer-shell |
Interesting, though requiring LD_PRELOAD doesn't look good.
Think a little more, i also think mutter doesn't expose enough that allow us to implement a layer_surface externally too (I don't think we can emit the configure and closed events when required, neither implement the get_popup and set_keyboard_interactivity requests). We would need to have a way to integrate the protocol with mutter internal handling of surfaces. |
It is possible to use it with GTK4 directly as I did here, we have access to the wl_surface https://github.com/elementary/screenshot/pull/275/files#diff-1379e6216d75e1e621858978bb52674e30fa2d0e9025920154fe5404af973bf9R262 |
It seems it's failing on OS 8, mutter 45.3 with
Once again I might be doing something horribly wrong if so just minimize this comment :) |
gtk4-layer-shell does not require LD_PRELOAD as long as the libraries are linked in the correct order. See https://github.com/wmww/gtk4-layer-shell/blob/main/linking.md for details. |
I'll do some more testing just writing here if someone has ideas but maybe I'm also completely wrong :) Looking at the c code this line seems to be the problem:
where This is the definition of wl_global_create
IIUC above line should actually be
So I guess that might be a VAPI problem? |
Ok I can confirm that by editing the c file and changing the line to the new line it does actually work. See #1871 |
f4935ee
to
96eb93a
Compare
@leolost2605 I've updated the .vapi so it should now work 🙂 |
It does indeed show up now (🥳) but it currently doesn't work with the screenshot implementation so I can't really test whether this works :( |
d25ee87
to
bcc2f0e
Compare
@leolost2605 based on your findings, I've updated the .vapi as wl_resource_create doesn't in fact return a reference to Wl.Resource as it is owned by the Wl.Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you that's much cleaner and works! Only minor nitpick, apart from that do you want to merge this and then finish API or do you want to get it done here? (Not implementation only specification I mean)
This is quite hacky but this open the way to using the pantheon-desktop-shell protocol.
bcc2f0e
to
2175085
Compare
Yes let's merge this and implement it afterwards to unblock this 🙂 |
Pull request was closed
This is quite hacky but this open the way to using the pantheon-desktop-shell protocol.