Test that manager listen to appropriate events
This commit is contained in:
parent
20cdec5fce
commit
26bac5aea9
8
features/manager/input_events.feature
Normal file
8
features/manager/input_events.feature
Normal file
@ -0,0 +1,8 @@
|
||||
Feature: input events selection
|
||||
|
||||
Scenario: selects the appropriate input event mask for a window manager
|
||||
Given uhwm is running
|
||||
Then the input event mask must include StructureNotifyMask
|
||||
And the input event mask must include SubstructureNotifyMask
|
||||
And the input event mask must include SubstructureRedirectMask
|
||||
And the input event mask must include PropertyChangeMask
|
@ -18,3 +18,7 @@ end
|
||||
Then /^the window must be focused$/ do
|
||||
expect(x_focused_window_id).to eq x_window_id
|
||||
end
|
||||
|
||||
Then /^the input event mask must include (.+)$/ do |mask|
|
||||
expect(x_input_event_masks).to include mask
|
||||
end
|
||||
|
@ -64,6 +64,10 @@ module Uh
|
||||
Integer(`xdpyinfo`[/^focus:\s+window\s+(0x\h+)/, 1])
|
||||
end
|
||||
|
||||
def x_input_event_masks
|
||||
`xdpyinfo`[/current input event mask:\s+0x\h+([\w\s]+):/, 1].split(/\s+/).grep /Mask\z/
|
||||
end
|
||||
|
||||
def x_key key
|
||||
fail "cannot simulate X key `#{key}'" unless system "xdotool key #{key}"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user