Make the manager listen for changes on new window
When mapping a new window, listen for property notify events.
This commit is contained in:
parent
03a6c323ac
commit
933bcdfcd8
@ -59,6 +59,7 @@ module Uh
|
||||
return if window.override_redirect? || client_for(window)
|
||||
@clients << client = Client.new(window)
|
||||
@events.emit :manage, args: client
|
||||
@display.listen_events window, Events::PROPERTY_CHANGE_MASK
|
||||
end
|
||||
|
||||
def unmap window
|
||||
|
@ -133,6 +133,8 @@ module Uh
|
||||
end
|
||||
|
||||
describe '#map' do
|
||||
let(:display) { instance_spy Display }
|
||||
|
||||
it 'registers a new client wrapping the given window' do
|
||||
manager.map window
|
||||
expect(manager.clients[0])
|
||||
@ -159,6 +161,13 @@ module Uh
|
||||
end
|
||||
manager.map window
|
||||
end
|
||||
|
||||
it 'listens for property notify events on given window' do
|
||||
expect(display)
|
||||
.to receive(:listen_events)
|
||||
.with window, Events::PROPERTY_CHANGE_MASK
|
||||
manager.map window
|
||||
end
|
||||
end
|
||||
|
||||
describe '#unmap' do
|
||||
|
Loading…
x
Reference in New Issue
Block a user