Feat/touch activates screen (extra logging)#157
Closed
Conversation
Add a touchActivateScreen option that switches keyboard/mouse focus to whichever computer the user touches. Works bidirectionally between server and clients, and detects touch in all applications including Chrome, Electron, UWP, and legacy Win32 apps. Touch detection uses three independent paths for broad hardware coverage: low-level mouse hook (dwExtraInfo MI_WP_SIGNATURE), raw input (RIDEV_INPUTSINK on desk thread for WM_INPUT), and WM_POINTER messages (Win8+ API). All three converge through debounced event dispatch to the server's screen-switch logic. Raw input is registered on the desk thread window rather than the main window because the main event loop uses QS_ALLPOSTMESSAGE, which never wakes for WM_INPUT messages. Cursor hiding on touchscreen clients uses a full-screen hider window with a blank cursor class instead of ShowCursor(FALSE), which is unreliable on touch hardware. WS_EX_TRANSPARENT is toggled on leave/enter for correct hit-testing. The server synthesizes a click and forces the foreground window after touch-triggered switches so the window under the touch point receives focus. A 500ms cooldown prevents edge-triggered switches from immediately undoing touch switches. Tested on: - Server: ASUS 3090DEV, i9-12900K, RTX 3090, Windows 11 Enterprise Build 26100 (64-bit), USB HID touch screen (VID 0457 / PID 0819) - Client: Microsoft Surface Book (1st gen), integrated touchscreen, Windows 11 - Applications tested: Chrome, Cursor (Electron), Windows Settings (UWP), Notepad, Synergy GUI, Start menu, File Explorer
…on, comment cleanup - Create ClientProxy1_9 for kMsgCGrabScreen (was incorrectly in ClientProxy1_0, breaking backward compatibility with older clients) - Bump protocol version 1.8 → 1.9 for touch-activated screen switching - Move Windows-specific SetForegroundWindow logic from Server.cpp to MSWindowsScreen::activateWindowAt() via platform abstraction chain - Remove dead mouseDown/mouseUp calls (PrimaryClient ignores them) - Remove #if WINAPI_MSWINDOWS and Windows.h include from Server.cpp - Clean up comments: keep only "why" comments, remove "what" comments Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vers A 1.9 client connecting to a 1.8 server would be rejected as incompatible. Add compat table entry so the client downgrades to 1.8 (touch-to-switch unavailable, but connection works). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename grabScreen -> grabInput (avoid "screen" ambiguity) - Strip "what" comments, keep only "why" explanations - Remove Win7/Win8 backwards-compat guards (direct WM_POINTER/GetPointerType) - Fix cursor hiding on secondary touchscreen clients (WM_MOUSEMOVE hider dismissal) - Update copyright dates to 2012-2026 - Drop compat table entry, clean up empty virtuals and doxygen blocks
- Save foreground window in secondary deskLeave so deskEnter can restore it; fixes SetForegroundWindow failing on re-enter which required a double-tap to click after switching - Skip hider auto-hide on touch-generated WM_MOUSEMOVE by checking the MI_WP_SIGNATURE touch signature via GetMessageExtraInfo - Restrict WM_INPUT raw touch handler to primary screens; on clients GetCursorPos returns the parked center position, not the touch point, causing clicks to land at screen center - Only eat touch events in the LL hook when in relay mode, not watch mode; fixes touch on server's secondary touchscreens acting as a giant cursor on the primary monitor - Move TOUCH_SIGNATURE defines to dfwhook.h shared header - Add diagnostic logging to activateWindowAt and click replay path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #147