🐞 Fix makeKeyWindow NaN coords that terminate Chromium PWA shims (#1131) - #1132
Merged
mrkai77 merged 5 commits intoAug 9, 2026
Merged
Conversation
Isolate a removable AX resize workaround for Chromium app-mode PWAs so Loop can snap them without triggering the shim's NSInvalidArgumentException / channel-error quit path. Co-authored-by: Cursor <cursoragent@cursor.com>
jvanderen1
marked this pull request as draft
August 2, 2026 19:38
jvanderen1
marked this pull request as ready for review
August 2, 2026 19:44
6 tasks
Point reviewers at the public duplicate and restricted canonical bugs so the workaround can be removed once Chromium ships a fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace 0xFF-filled windowLocation bytes (decoded as NaN) with a finite off-content point, matching AltTab. Chromium’s Mojo path terminates the app-shim connection when it receives those NaNs (mrkai77#1131). Also widen the event buffer to 0x100 and drop the Chromium-specific resize workaround. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Updated per @mrkai77’s feedback on #1131:
Net diff vs |
Extract magic offsets into MakeKeyWindowEvent for readability, matching AltTab’s structure. No behavior change. Co-authored-by: Cursor <cursoragent@cursor.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.
Description
Loop’s synthetic
makeKeyWindowfocus event filledwindowLocationwith0xFFbytes, which decode as NaN doubles. A Chromium regression caused Mojo to terminate the PWA app-shim connection when those values were received (app_shim_controller.mm:679Channel error), so installed Chromium/Brave/Edge PWAs quit when Loop focused them before resize.This ports AltTab’s fix:
CGPoint(x: -1, y: -1)instead of0xFFfill0x100(record length stays0xf8)The earlier Chromium-PWA-only resize workaround was removed in favor of this general fix.
Upstream:
Fixes #1131
How has this been tested?
Tested on macOS Tahoe 26.6 with a local Debug build.
Screencast
Screencast of Chromium PWA snapping successfully is attached on the PR timeline / issue.
output.mp4
Checklist:
Please describe to which degree, if any, an LLM was used in creating this pull request.
Cursor Agent assisted with root-cause investigation, the initial Chromium-PWA workaround, and rewriting this PR to the AltTab-style
makeKeyWindowfix after Chromium clarified the NaN/Mojo cause. Behavior verified manually on-device; approach aligned with maintainer feedback on #1131.