diff --git a/lib/uh/wm/client.rb b/lib/uh/wm/client.rb index ec08d3e..0d80e63 100644 --- a/lib/uh/wm/client.rb +++ b/lib/uh/wm/client.rb @@ -34,6 +34,12 @@ module Uh @window.moveresize @geo self end + + def show + @window.map + @visible = true + self + end end end end diff --git a/spec/uh/wm/client_spec.rb b/spec/uh/wm/client_spec.rb index 06a81bb..da133d4 100644 --- a/spec/uh/wm/client_spec.rb +++ b/spec/uh/wm/client_spec.rb @@ -56,6 +56,23 @@ module Uh expect(client.moveresize).to be client end end + + describe '#show' do + it 'maps the window' do + expect(window).to receive :map + client.show + end + + it 'toggles the client as visible' do + expect { client.show } + .to change { client.visible? } + .from(false).to true + end + + it 'returns self' do + expect(client.show).to be client + end + end end end end