← Commit history

0.9.321: Tour: 'in front' ignores shell popups, minimized windows and our own overlays (arav-rog measured RustDesk minimized and PopupHost as the top window); footprint beat retries twice without the plugin wait; 2D motion recenters when a pan or zoom empties the canvas

John Lauer ·d106f8f1c5 ·1mo ago ·parent 402342a
1 file changed +12−1
handlers/demo_motion.py+12−1
@@ -183,7 +183,7 @@ def choreograph_3d_menu(hwnd: int, abort=None, log=None) -> dict | None:     return rep  -def choreograph(hwnd: int, kind: str, abort=None, log=None) -> dict:+def choreograph(hwnd: int, kind: str, abort=None, log=None, check=None) -> dict:     """Run the beat's motion on `hwnd`. kind: '2d' | '3d'. Returns a report;     never raises. Stops the instant the window is not in front or abort()."""     rep = {"kind": kind, "gestures": 0, "aborted": None}@@ -253,6 +253,17 @@ def choreograph(hwnd: int, kind: str, abort=None, log=None) -> dict:             if log:                 log(f"motion {kind}: {name}")             time.sleep(0.45)+            # John, 2026-09-05: "don't be dumb about your zooming or panning such+            # that content goes off the screen ... analyze your motion". After+            # every 2D gesture that can empty the view, look at the canvas; a+            # blank one means we panned off the content: recenter on extents.+            if check and kind != "3d" and name.startswith(("pan", "zoom-in")):+                try:+                    if not check():+                        key(VK_HOME); time.sleep(0.45)+                        rep.setdefault("recentered", []).append(name)+                except Exception:  # pylint: disable=broad-except+                    pass     except Exception as e:  # pylint: disable=broad-except         rep["error"] = f"{type(e).__name__}: {e}"     return rep