pentamassiv / gtk4-layer-shell-gir

Unsafe bindings and a safe wrapper for gtk4-layer-shell, automatically generated from a .gir file
MIT License
23 stars 2 forks source link

[BUG] error(zwlr_layer_surface_v1@41, 2, "layer_surface has never been configured") #28

Closed madonuko closed 3 weeks ago

madonuko commented 9 months ago

Running gtk4-layer-shell 0.2.0 on my computer under Wayfire causes this (consistently):

This issue is not reproducible on my colleagues' computers and only my machine with Wayfire. Not reproducible under Sway.

Changing the code to this also causes the issue:

let window = libhelium::Window::new();
window.init_layer_shell();
window.set_layer(Layer::Overlay);

The problem seems to be that its buffers get attached before configure(). I've talked to the Wayfire devs (big thanks to everyone there!) and we've confirmed the issue comes from gtk4-layer-shell.

pentamassiv commented 9 months ago

I'd be surprised if it has to do with the Rust bindings, since they are just an autogenerated wrapper of the C library, but we can leave this issue open so others can see it

Ferdi265 commented 2 months ago

I am able to reproduce this issue with the gtk4-layer-shell example "simple-example" with the following patch:

diff --git a/gtk4-layer-shell/examples/simple-example.rs b/gtk4-layer-shell/examples/simple-example.rs
index 32fa01d..8afa307 100644
--- a/gtk4-layer-shell/examples/simple-example.rs
+++ b/gtk4-layer-shell/examples/simple-example.rs
@@ -22,6 +22,10 @@ fn activate(application: &gtk::Application) {
     window.set_margin(Edge::Right, 40);
     window.set_margin(Edge::Top, 20);

+    window.connect_map(move |window| {
+        window.set_margin(Edge::Top, 30);
+    });
+
     // ... or like this
     // Anchors are if the window is pinned to each edge of the output
     let anchors = [
Ferdi265 commented 2 months ago

This appears to be an upstream issue, as the same reproducer works in the other bindings and in C as well.

madonuko commented 3 weeks ago

Seems to be fixed by https://github.com/wmww/gtk4-layer-shell/pull/49 (thank you!)