From c0612d1d7e78c413d0c69de34f1ae7951e90bc90 Mon Sep 17 00:00:00 2001 From: Aylur Date: Sun, 3 Nov 2024 01:05:50 +0000 Subject: lib(astal4): touchups --- lib/astal/gtk3/src/widget/window.vala | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lib/astal/gtk3/src') diff --git a/lib/astal/gtk3/src/widget/window.vala b/lib/astal/gtk3/src/widget/window.vala index 9287200..11d542d 100644 --- a/lib/astal/gtk3/src/widget/window.vala +++ b/lib/astal/gtk3/src/widget/window.vala @@ -47,28 +47,27 @@ public enum Astal.Keymode { * Subclass of [class@Gtk.Window] which integrates GtkLayerShell as class fields. */ public class Astal.Window : Gtk.Window { - private static bool check(string action) { + private InhibitManager? inhibit_manager; + private Inhibitor? inhibitor; + + private bool check(string action) { if (!is_supported()) { critical(@"can not $action on window: layer shell not supported"); print("tip: running from an xwayland terminal can cause this, for example VsCode"); return true; } + if (!is_layer_window(this)) { + init_for_window(this); + } return false; } - private InhibitManager? inhibit_manager; - private Inhibitor? inhibitor; - construct { - if (check("initialize layer shell")) - return; - // If the window has no size allocatoted when it gets mapped. // It won't show up later either when it size changes by adding children. height_request = 1; width_request = 1; - - init_for_window(this); + check("initialize layer shell"); inhibit_manager = InhibitManager.get_default(); } -- cgit v1.2.3