Mouse mux per window isolation#28
Closed
MouseMux wants to merge 20 commits intomozilla-firefox:mainfrom
Closed
Conversation
Simple boolean flag to enable/disable blocking of native mouse input.
Connects to MouseMux server and injects input via PostMessage directly to HWNDs. - No SendInput, no GetKeyState - only PostMessage with MouseMux data - Tracks button state internally from MouseMux events - Uses MOUSEMUX_MARKER (0x80000000) in wParam to identify injected messages - SDK v2.2.32 button event flags support
Win32 dialog with Connect/Disconnect and Block/Unblock buttons. Auto-opens on Firefox startup, always on top with taskbar entry.
- Register/unregister windows with MouseMuxService - Filter native mouse when blocking enabled, allow MOUSEMUX_MARKER messages - Strip marker before processing - F12 emergency exit when blocking enabled
- Block WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_CHAR, WM_SYSCHAR - Allow F12 through for emergency exit - Add MOUSEMUX_MARKER to keyboard messages from MouseMux
- Click on Firefox window sets that hwid as owner - Owner's mouse input always goes to owned window (even outside bounds) - Ownership transfers when different hwid clicks on window - Debug dialog shows current owner hwid in status bar
- Add MOUSEMUX_VERSION (3.0) to track builds - Add timestamps to log messages for debugging - Show version in dialog title Co-Authored-By: Claude <[email protected]>
- Each Firefox window now has its own MouseMuxClient instance - Each window manages its own WebSocket connection to MouseMux server - Each window has its own debug dialog (auto-opens, F11 to toggle) - Connect and Block Input are separate, independent actions - Fixed SDK message parsing to use correct v2.2.33 format: - pointer.motion.notify.M2A (not pointer_motion) - pointer.button.notify.M2A (not pointer_button) - pointer.scroll.notify.M2A (not pointer_scroll) - keyboard.notify.M2A (not keyboard) - x/y coordinates (not screen_x/screen_y) - data field for button info (not event_flags) - Fixed disconnect hang by using shutdown() + detach() - Added detailed logging with build timestamp Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Reverted keyboard from SendInput to PostMessage (rules compliant) - Fixed keyboard message type: keyboard.key.notify.M2A - Fixed keyboard field name: scan (not scan_code) - Simplified keyboard ownership check - Removed Log() from Disconnect to prevent crash - Added MouseMux-rules.md documenting prohibited APIs: - NO SendInput, keybd_event, mouse_event - NO GetKeyState, GetAsyncKeyState, SetCursorPos - ONLY PostMessage/SendMessage to target HWND Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Only log button, keyboard, and other non-motion events - Reduces log noise significantly for debugging Co-Authored-By: Claude Opus 4.5 <[email protected]>
- In nsWindow's WM_KEYDOWN/WM_KEYUP handlers, check if this is a top-level window with MouseMux connected - Use IMEHandler::GetFocusedWindow() to get Firefox's internally focused window - Forward keyboard messages to focused window instead of processing at top-level (fixes keyboard not reaching content) - Add PostMessage debug logging in MouseMuxClient This fixes the issue where PostMessage to the top-level window didn't route to the focused content area because Firefox's keyboard processing relies on GetFocus() which returns the system focus state. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Reverts the v4.9 change that required connection before enabling block. Block Input now works independently of connecting to MouseMux service. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Documents the current structure, components, and known issues. Notes: MouseMuxService and MouseMuxDebugDialog appear unused (legacy). Co-Authored-By: Claude Opus 4.5 <[email protected]>
The keyboard events from MouseMux were being blocked by InputFilter because they didn't have MOUSEMUX_MARKER set in wParam. Fixes: 1. MouseMuxClient::HandleKeyboard now adds MOUSEMUX_MARKER to vkey 2. nsWindow keyboard forwarding now re-adds MOUSEMUX_MARKER when forwarding to focused child window (marker is stripped by InputFilter) This allows keyboard events to pass through InputFilter when blocking is enabled, same as mouse events. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The WebSocket thread was calling UpdateDebugStatus() and AppendLog() directly, which modified UI elements from a background thread. This caused deadlocks when opening multiple Firefox windows. Fix: - AppendLog now queues log text and posts WM_MOUSEMUX_LOG to UI thread - Added FlushLogToUI() called only from UI thread - Replaced direct UpdateDebugStatus() calls from WebSocket thread with PostMessage(WM_MOUSEMUX_UPDATE) - Added WM_MOUSEMUX_UPDATE and WM_MOUSEMUX_LOG message handlers This ensures all UI updates happen on the main thread, preventing cross-thread deadlocks. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Per-window MouseMuxClient: each Firefox window owns its own client instance - Per-window InputFilter: use map<HWND, bool> instead of global static - Thread safety: non-blocking Disconnect() (detach instead of join), mThreadRunning flag with timeout wait in destructor - Multi-window fix: release ownership when mouse clicks outside window, allowing correct window to take ownership - UI improvements: show window title in dialog, left click logging, 800x400 dialog size, HWND in status bar - Removed old MouseMuxService and MouseMuxDebugDialog from build Co-Authored-By: Claude Opus 4.5 <[email protected]>
When a window has an owner (mouse that clicked), only that owner's motion/button/wheel events are processed. Other mice moving into the window bounds are now ignored, preventing coordinate interference when multiple users are active in different windows. Co-Authored-By: Claude Opus 4.5 <[email protected]>
…king - Motion events only processed from window owner - Button events only processed from owner (no takeover on click) - First click on unowned window claims ownership - Wheel events only processed from owner - Added per-window input filter enable/disable Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Fixed keyboard rejection logic to require positive identification - Request user list from server on connect (user.list.request.A2M) - Parse user.list.notify.M2A with devices[] array structure - Handle user.changed.notify.M2A for dynamic user updates - Block native keyboard input, only accept MouseMux events - Track per-window keyboard and mouse button state in InputFilter - KeyboardLayout uses InputFilter state instead of GetKeyState()
Contributor
|
(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.