Change the order of steps and add another check screen.

Since GDM shows the "system-menu-button", it could not correctly
switch users on a locked screen. I added a check to see
if we are on a locked screen and behave accordingly.
This commit is contained in:
Lukáš Růžička 2020-04-22 13:39:57 +02:00
parent 23904d71b2
commit fd3e4e3280
3 changed files with 20 additions and 5 deletions

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"locked_screen_switch_user"
],
"area": [
{
"xpos": 964,
"ypos": 709,
"width": 21,
"height": 19,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -139,7 +139,11 @@ sub logout_user {
sub switch_user {
# Switch the user, i.e. leave the current user logged in and
# log in another user simultaneously.
if (check_screen "system_menu_button") {
send_key "ret";
if (check_screen "locked_screen_switch_user") {
assert_and_click "locked_screen_switch_user";
}
elsif (check_screen "system_menu_button") {
# The system_menu_button indicates that we are in an active
# and unlocked session, where user switching differs
# from a locked but active session.
@ -150,10 +154,6 @@ sub switch_user {
# Add sleep to slow down the process a bit
sleep 10;
}
else {
# When the screen is locked, use the icon.
assert_and_click "locked_screen_switch_user";
}
}
sub reboot_system {