Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/crutchcorn/hearthspace. A spatial Linux desktop for persistent, local-first computing.
Something went wrong. Try again.
2.4 kB · 61 lines
Python
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162"""Verify tray menu taps through the owned native kernel touchscreen path."""
from pathlib import Path
from . import shell_checks, tray_checksfrom .control import ControlErrorfrom .pinch_touchscreen import to_devicefrom .shell_presentation import park_pointerfrom .touchpad import TouchDevice
def run(smoke, peer): status = smoke.control.status() if status["backend"] != "native": return output = status["outputs"][0] park_pointer(smoke, output) path = smoke.artifacts / "libinput-tray-touchscreen.log" with ( path.open("w") as log, TouchDevice( smoke.directory, log, "touchscreen", deadline=smoke.control.deadline ) as device, ): smoke.record("tray-touchscreen-created", **device.device)
def tap(name, *, menu=False, hold=False): point = tray_checks.point(smoke, name, menu=menu) device.request("begin", fingers=1, points=to_device([point], output)) try: # Wait for a real presentation while the contact is held. if hold: smoke.until( "touch hold opens app menu", lambda: shell_checks.panel(smoke, "tray"), ) else: smoke.control.capture(output["name"]) finally: device.request("end")
before = len(peer.events()) tap(tray_checks.TITLE) peer.expect("activate", after=before) tap(tray_checks.TITLE, hold=True) shell_checks.opened(smoke, "tray") smoke.until( "touch opens application menu", lambda: tray_checks.visible(smoke, "Open fixture"), ) tray_checks.snapshot(smoke, "tray-touch-menu") before = len(peer.events()) tap("Open fixture", menu=True) peer.expect("menu", after=before, id=1, event="clicked") shell_checks.closed(smoke) if Path(device.device["device"]).exists(): raise ControlError("owned tray touchscreen survived cleanup") trace = path.read_text() if any(event not in trace for event in ("TOUCH_DOWN", "TOUCH_UP", "TOUCH_FRAME")): raise ControlError("tray taps lack real kernel touchscreen evidence") smoke.record("tray-touchscreen-verified", trace=str(path), removed=True)