diff options
author | kotontrion <[email protected]> | 2024-09-28 18:03:31 +0200 |
---|---|---|
committer | kotontrion <[email protected]> | 2024-09-28 18:03:31 +0200 |
commit | 0fd6a5f56033f83f246b9dd51c6521bf6f105b8f (patch) | |
tree | ecc44e344e1264af3b56e91cd521b732c60c9992 /core | |
parent | d884f1985c828b4a58e635b3405138e23026de72 (diff) |
lua: fix astalified container
Diffstat (limited to 'core')
-rw-r--r-- | core/gjs/src/astalify.ts | 4 | ||||
-rw-r--r-- | core/lua/astal/widget.lua | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/gjs/src/astalify.ts b/core/gjs/src/astalify.ts index 8778be0..a3e5f62 100644 --- a/core/gjs/src/astalify.ts +++ b/core/gjs/src/astalify.ts @@ -19,7 +19,9 @@ function setChildren(parent: Gtk.Widget, children: Gtk.Widget[]) { if (ch) parent.remove(ch) } - else if (parent instanceof Gtk.Container) { + else if (parent instanceof Gtk.container && + !(parent instanceof Astal.Box || + parent instanceof Astal.Stack)) { for(const ch of parent.get_children()) parent.remove(ch) } diff --git a/core/lua/astal/widget.lua b/core/lua/astal/widget.lua index 1f5b07b..f525f4e 100644 --- a/core/lua/astal/widget.lua +++ b/core/lua/astal/widget.lua @@ -60,6 +60,12 @@ local function set_children(parent, children) if rm ~= nil then parent:remove(rm) end + elseif Gtk.Container:is_type_of(parent) and + !(Astal.Box:is_type_of(parent) or + Astal.Stack:is_type_of(parent)) then + for _, ch in ipairs(parent:get_children()) do + parent:remove(ch) + end end -- TODO: add more container types |