Improvements

This commit is contained in:
2026-07-02 12:43:02 +01:00
parent d1e13093c5
commit 49ba7ddb41
14 changed files with 187 additions and 74 deletions
+12 -2
View File
@@ -1,3 +1,7 @@
def godot_window?(window)
`xprop -id #{window} WM_CLASS`.downcase.include?("godot")
end
class Window
attr_accessor :window_id, :floating, :workspace, :def_floating, :size, :x, :y, :width, :height
@@ -5,8 +9,14 @@ class Window
@size = 0
@workspace = workspace
@window_id = window_id
geometry = X.get_geometry(window_id)
@x = geometry[:x]
@y = geometry[:y]
@width = geometry[:width]
@height = geometry[:height]
wm_n_hints = X.get_wm_n_hints(window_id)
@floating = false
@floating = godot_window?(window_id)
@def_floating = @floating
if wm_n_hints
if fixed_size_or_aspect?(wm_n_hints)
@floating = true
@@ -24,7 +34,7 @@ class Window
end
X.set_wm_state window_id, 1
transient_for = X.get_wm_transient_for(window_id)
unless transient_for.zero?
if !transient_for.zero? && !godot_window?(window_id)
@floating = true
@def_floating = true
@width = wm_n_hints[:max_width]