Implement Manager#configure

This commit is contained in:
Thibault Jouan
2015-04-20 04:59:55 +00:00
parent 7fc695f258
commit 1f7b2269c7
2 changed files with 39 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ module Uh
Events::SUBSTRUCTURE_REDIRECT_MASK |
Events::SUBSTRUCTURE_NOTIFY_MASK |
Events::STRUCTURE_NOTIFY_MASK
DEFAULT_GEO = Geo.new(0, 0, 320, 240).freeze
attr_reader :modifier, :display, :clients
@@ -45,6 +46,15 @@ module Uh
@display.grab_key keysym.to_s, mod_mask
end
def configure window
if client = client_for(window)
client.configure
else
geo = @events.emit :configure, args: window
window.configure_event geo ? geo : DEFAULT_GEO
end
end
def manage window
return if window.override_redirect? || client_for(window)
@clients << client = Client.new(window)