diff options
author | Aylur <[email protected]> | 2024-11-03 02:51:15 +0100 |
---|---|---|
committer | Aylur <[email protected]> | 2024-11-03 02:52:59 +0100 |
commit | 510b233438987890d794644da909f6cf34d03a42 (patch) | |
tree | fd97a590d3af33f5042f2def1545160bfc187ac9 /lib/astal/gtk3/src/widget | |
parent | da892f050143807f8a267dbbee1527cf655876b8 (diff) | |
parent | c0612d1d7e78c413d0c69de34f1ae7951e90bc90 (diff) |
Merge branch 'feat/gtk4'
initial gtk4 app and window
Diffstat (limited to 'lib/astal/gtk3/src/widget')
-rw-r--r-- | lib/astal/gtk3/src/widget/window.vala | 17 |
1 files changed, 8 insertions, 9 deletions
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 [[email protected]] 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(); } |