Implement client visibility state
This commit is contained in:
parent
1a1f181313
commit
15f966654b
@ -5,14 +5,23 @@ module Uh
|
|||||||
attr_accessor :geo
|
attr_accessor :geo
|
||||||
|
|
||||||
def initialize window, geo = nil
|
def initialize window, geo = nil
|
||||||
@window = window
|
@window = window
|
||||||
@geo = geo
|
@geo = geo
|
||||||
|
@visible = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
"<#{name}> (#{wclass}) #{@geo} win: #{@window}"
|
"<#{name}> (#{wclass}) #{@geo} win: #{@window}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def visible?
|
||||||
|
@visible
|
||||||
|
end
|
||||||
|
|
||||||
|
def hidden?
|
||||||
|
not visible?
|
||||||
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
@wname ||= @window.name
|
@wname ||= @window.name
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,14 @@ module Uh
|
|||||||
end
|
end
|
||||||
subject(:client) { described_class.new window, geo }
|
subject(:client) { described_class.new window, geo }
|
||||||
|
|
||||||
|
it 'is not visible' do
|
||||||
|
expect(client).not_to be_visible
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'is hidden' do
|
||||||
|
expect(client).to be_hidden
|
||||||
|
end
|
||||||
|
|
||||||
describe '#to_s' do
|
describe '#to_s' do
|
||||||
it 'includes window name' do
|
it 'includes window name' do
|
||||||
expect(client.to_s).to include 'wname'
|
expect(client.to_s).to include 'wname'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user