Ensure only one client is managed for given window

This commit is contained in:
Thibault Jouan
2015-04-19 05:11:01 +00:00
parent 036ca1f989
commit bdbeca399a
7 changed files with 40 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ module Uh
end
def manage window
return if window.override_redirect?
return if window.override_redirect? || client_for(window)
@clients << client = Client.new(window)
@events.emit :manage, args: client
end
@@ -83,6 +83,10 @@ module Uh
manage event.window
end
def client_for window
@clients.find { |e| e.window == window }
end
def check_other_wm!
Display.on_error { fail OtherWMRunningError }
@display.listen_events INPUT_MASK

View File

@@ -89,8 +89,9 @@ module Uh
@x_client.window_name
end
def x_window_map
x_client.map.sync
def x_window_map times: 1
times.times { x_client.map }
x_client.sync
end
def x_window_map_state