Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tails
tails
Commits
131449a6
Commit
131449a6
authored
Sep 18, 2015
by
kytv
Browse files
Retry focusing the window on failure after redrawing the screen
parent
1e9e5236
Changes
1
Hide whitespace changes
Inline
Side-by-side
features/support/helpers/vm_helper.rb
View file @
131449a6
...
...
@@ -417,9 +417,23 @@ EOF
end
def
focus_window
(
window_title
,
user
=
LIVE_USER
)
execute_successfully
(
"xdotool search --name '
#{
window_title
}
' windowactivate --sync"
,
user
)
def
do_focus
(
window_title
,
user
)
execute_successfully
(
"xdotool search --name '
#{
window_title
}
' windowactivate --sync"
,
user
)
end
begin
do_focus
(
window_title
,
user
)
rescue
ExecutionFailedInVM
# Often when vdotool fails to focus a window it'll work when retried
# after redrawing the screen. Switching to a new virtual desktop then
# back seems to be a reliable way to handle this.
select_virtual_desktop
(
3
)
select_virtual_desktop
(
0
)
sleep
1
do_focus
(
window_title
,
user
)
end
end
def
file_exist?
(
file
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment