Improvements
This commit is contained in:
+12
-2
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user