GTK4 and ext-session-lock-v1 #57
-
Hi everyone! I'm looking to implement a screen locker with the The session lock protocol requires the user to pass a surface for each screen, which will be exclusively displayed on that screen. In GTK3, that was possible like this (in rust): let wl_window = gtk_window.downcast::<gdkwayland::WaylandWindow>().unwrap();
gdk_wayland_sys::gdk_wayland_window_set_use_custom_surface(wl_window.to_glib_none().0);
let wl_surface = get_wl_surface(&wl_window); // omitted helper function
session_lock.create_lock_surface(surface, &output, &queue_handle); Since It seems from reading the discussions on the gtk3 repo for this library that a lot of the difficulty with porting this library came from the fact that
2 is definitely not a problem, since the session lock protocol only allows one surface per screen, which rules out popups in general. I haven't tested yet if the wayland client libraries are fine with receiving an XDG surface, I'll do that later today. Does anyone have any thoughts on how this could work? Could techniques from this library be used to help me? Are there other effects of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
EDIT: proper session lock support has now landed in main, and will be released shortly Hi! Seems like you're on the right track. The main issue with using the session lock protocol with GTK is indeed stopping GTK from creating an XDG shell surface. I strongly suggest using the approach this library does, as explained here and mostly implemented here. Since |
Beta Was this translation helpful? Give feedback.
EDIT: proper session lock support has now landed in main, and will be released shortly
Hi! Seems like you're on the right track. The main issue with using the session lock protocol with GTK is indeed stopping GTK from creating an XDG shell surface. I strongly suggest using the approach this library does, as explained here and mostly implemented here.
Since
ext-session-lock-v1
is a well established and useful protocol, I'd consider adding support for it to this library. Not sure if I'll get around to it any time soon, but PRs absolutely welcome.