diff --git a/.github/qa/wayland-pen.py b/.github/qa/wayland-pen.py index 6264fcfb85..f0777e9cfd 100644 --- a/.github/qa/wayland-pen.py +++ b/.github/qa/wayland-pen.py @@ -40,8 +40,8 @@ with connection, connection.makefile("rwb") as stream: assert window["focused"] and window["shell"] == "xdg_shell", window a, b, width, height = view["canvasRect"] extent = window["rect"] - x = round(extent["x"] + (a + width/2)*extent["width"]/view["window"][0]) - y = round(extent["y"] + (b + height/2)*extent["height"]/view["window"][1]) + x = round(extent["x"] + (a + width*0.43)*extent["width"]/view["window"][0]) + y = round(extent["y"] + (b + height*0.39)*extent["height"]/view["window"][1]) pointer_process = subprocess.Popen([os.environ["RUNNER_TEMP"]+"/test-pointer",str(x),str(y),"1600","1000"], stdin=subprocess.PIPE) time.sleep(1) for filename, extra in [("without",[]),("with",["-c"])]: @@ -57,7 +57,7 @@ with connection, connection.makefile("rwb") as stream: if bounds is None: away = Image.open(directory/"away.png").convert("RGB") bounds = ImageChops.difference(shown.crop(area),away.crop(area)).getbbox() - print("Pointer is painted by the application", flush=True) + print("Compared canvas pixels before and after moving the pointer", flush=True) assert bounds, ("moving the seat pointer changed no pixels", x, y, view["canvasRect"], subprocess.check_output(["swaymsg","-rt","get_seats"]).decode()) pointer = shown.crop(area).crop(bounds) pointer.resize((pointer.width*8,pointer.height*8),Image.Resampling.NEAREST).save(directory/"nib.png")