Ensure only one client is managed for given window
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user