parent
4ec318c2b5
commit
3547aa38ff
@ -1,53 +0,0 @@
|
|||||||
From 851639f604959cdea0448771cd694da2a00f16a1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Adam Williamson <awilliam@redhat.com>
|
|
||||||
Date: Tue, 28 Mar 2017 21:02:11 -0700
|
|
||||||
Subject: [PATCH] Fix assert_and_click mouse hiding
|
|
||||||
|
|
||||||
See https://progress.opensuse.org/issues/17058#note-7 - #728
|
|
||||||
caused a problem with the cursor reposition that occurs at the
|
|
||||||
end of `assert_and_click`, in the case that the cursor had not
|
|
||||||
been explicitly positioned before the `assert_and_click`. In
|
|
||||||
this case, `assert_and_click` is meant to call `mouse_hide`.
|
|
||||||
However, #728 made `get_last_mouse_set` *always* return defined
|
|
||||||
values, while `assert_and_click` expected it to return undefined
|
|
||||||
values when the cursor had never been positioned, so it wound
|
|
||||||
up trying to position the cursor to -1, -1 instead of calling
|
|
||||||
`mouse_hide`.
|
|
||||||
|
|
||||||
The fix is pretty simple: just adapt the condition to the new
|
|
||||||
behaviour of `get_last_mouse_set`.
|
|
||||||
---
|
|
||||||
t/03-testapi.t | 3 +++
|
|
||||||
testapi.pm | 2 +-
|
|
||||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/t/03-testapi.t b/t/03-testapi.t
|
|
||||||
index cc28e65..067dcdc 100755
|
|
||||||
--- a/t/03-testapi.t
|
|
||||||
+++ b/t/03-testapi.t
|
|
||||||
@@ -45,6 +45,9 @@ sub fake_read_json {
|
|
||||||
elsif ($cmd eq 'backend_mouse_hide') {
|
|
||||||
return {ret => 1};
|
|
||||||
}
|
|
||||||
+ elsif ($cmd eq 'backend_get_last_mouse_set') {
|
|
||||||
+ return {ret => {x => -1, y => -1}};
|
|
||||||
+ }
|
|
||||||
else {
|
|
||||||
print "not implemented \$cmd: $cmd\n";
|
|
||||||
}
|
|
||||||
diff --git a/testapi.pm b/testapi.pm
|
|
||||||
index ddaea09..0fb61cb 100755
|
|
||||||
--- a/testapi.pm
|
|
||||||
+++ b/testapi.pm
|
|
||||||
@@ -418,7 +418,7 @@ sub assert_and_click {
|
|
||||||
sleep 1;
|
|
||||||
# move mouse back to where it was before we clicked, or to the 'hidden'
|
|
||||||
# position if it had never been positioned
|
|
||||||
- if (defined $old_mouse_coords->{x} && defined $old_mouse_coords->{y}) {
|
|
||||||
+ if ($old_mouse_coords->{x} > -1 && $old_mouse_coords->{y} > -1) {
|
|
||||||
return mouse_set($old_mouse_coords->{x}, $old_mouse_coords->{y});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
--
|
|
||||||
2.12.1
|
|
||||||
|
|
@ -1 +1 @@
|
|||||||
SHA512 (os-autoinst-d8f75d2bc24f63a58545d20b79064a7131d41aa2.tar.gz) = 90b48daf78532e7b99d8cbeffc4a6d03f29a36db78f3e4c546f6b97243088cb2bde97022d687932de085ea0335f9a596e447b86e1c7861a8143f4ee64877046f
|
SHA512 (os-autoinst-97928a217534270621c278b0442b12f9b3f46419.tar.gz) = 3c5f7fadb83f8c1b8f8b17b56187b5fd240527a8f81e35eba02432bc9f60effa9b845668f482e5a8549f5ea1816d52143d9c3221e25845d12a8cea5a31b71ecf
|
||||||
|
Loading…
Reference in new issue