diff --git a/lib/uh/wm/client.rb b/lib/uh/wm/client.rb index 1eea9b9..464d637 100644 --- a/lib/uh/wm/client.rb +++ b/lib/uh/wm/client.rb @@ -31,6 +31,11 @@ module Uh @wclass ||= @window.wclass end + def update_window_properties + @wname = @window.name + @wclass = @window.wclass + end + def configure @window.configure @geo self diff --git a/spec/uh/wm/client_spec.rb b/spec/uh/wm/client_spec.rb index d246842..d074646 100644 --- a/spec/uh/wm/client_spec.rb +++ b/spec/uh/wm/client_spec.rb @@ -47,6 +47,24 @@ module Uh end end + describe '#update_window_properties' do + it 'updates the cached window name' do + client.name + allow(window).to receive(:name) { 'new name' } + expect { client.update_window_properties } + .to change { client.name } + .from('wname').to 'new name' + end + + it 'updates the cached window class' do + client.wclass + allow(window).to receive(:wclass) { 'new class' } + expect { client.update_window_properties } + .to change { client.wclass } + .from('wclass').to 'new class' + end + end + describe '#configure' do it 'configures the window with client geo' do expect(window).to receive(:configure).with geo