class Tiling::Windows

Public: Find our windows.

Attributes

master[R]

Public Class Methods

new(workspace) click to toggle source
# File lib/tiling/windows.rb, line 9
def initialize workspace
  @workspace = workspace
  @wm = WMCtrl.instance
  find_windows
end

Public Instance Methods

count() click to toggle source
# File lib/tiling/windows.rb, line 19
def count
  @windows.count
end
each(&block) click to toggle source
# File lib/tiling/windows.rb, line 23
def each &block
  @windows.each &block
end
empty?() click to toggle source
# File lib/tiling/windows.rb, line 15
def empty?
  @windows.empty?
end

Private Instance Methods

find_windows() click to toggle source
# File lib/tiling/windows.rb, line 29
def find_windows
  @windows = windows_in_active_workspace
  put_active_window_on_top
  @master = get_master_window
end
get_master_window() click to toggle source
# File lib/tiling/windows.rb, line 43
def get_master_window
  @windows.slice!(0)
end
put_active_window_on_top() click to toggle source
# File lib/tiling/windows.rb, line 39
def put_active_window_on_top
  @windows.sort! { |x,y| y[:active] ? 1 : -1 }
end
windows_in_active_workspace() click to toggle source
# File lib/tiling/windows.rb, line 35
def windows_in_active_workspace
  @wm.windows.select { |win| win[:desktop] == @workspace.id }
end