From ab91b5e7c1c2d845026412d95d6656631b2942c9 Mon Sep 17 00:00:00 2001 From: arcattack Date: Sun, 26 Jul 2026 14:51:21 -0500 Subject: [PATCH] clickbank: never target a degenerate window (the 0x0 Plasma window ate all 144 clicks) The picker matched any visible window whose title contains the substring and took windows[0] -- which for a live game is 'BattleTech - Plasma', a 0x0-client window. Every posted click landed in it: 144 clicks, zero dispatches, and what looked exactly like the click/render alignment regression being checked for. Windows with a client smaller than 50x50 are skipped now; verified by re-running the full 72-button pass with the broad 'BattleTech' title straight through to 72/72 dispatches. (Found during the post-merge alignment regression check: boot geometry, a mid-session resize to an odd 1120x640 letterbox, and a minimize/restore cycle -- 72/72 dispatched in every round, 288 clicks total, zero Gitea #56 tripwire lines. The merge did NOT regress click-vs-render alignment.) Co-Authored-By: Claude Opus 5 (1M context) --- scratchpad/clickbank.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scratchpad/clickbank.py b/scratchpad/clickbank.py index c0d6fb6..9d0bc56 100644 --- a/scratchpad/clickbank.py +++ b/scratchpad/clickbank.py @@ -60,7 +60,15 @@ def find_windows(substring): buffer = ctypes.create_unicode_buffer(length + 1) user32.GetWindowTextW(hwnd, buffer, length + 1) if substring.lower() in buffer.value.lower() and user32.IsWindowVisible(hwnd): - found.append((hwnd, buffer.value)) + # Skip zero/degenerate clients: the game also owns a + # "BattleTech - Plasma" window with a 0x0 client, and taking + # windows[0] blindly posted every click into it -- 144 clicks, + # zero dispatches, and a scary-looking false regression + # (2026-07-26). A window you cannot click in is not a target. + r = RECT() + user32.GetClientRect(hwnd, ctypes.byref(r)) + if r.right > 50 and r.bottom > 50: + found.append((hwnd, buffer.value)) return True user32.EnumWindows(callback, 0)