Fix: Enable Xpra desktop canvas resize during browser window resize#1650
Open
gdeyoung wants to merge 3 commits into
Open
Fix: Enable Xpra desktop canvas resize during browser window resize#1650gdeyoung wants to merge 3 commits into
gdeyoung wants to merge 3 commits into
Conversation
The client.__a0ViewportResizing flag was checked in installXpraDesktopClientPatches but never actually set during the queueDesktopResize flow. This prevented the desktop canvas from resizing when the user resized their browser window. - Modified refreshFrameOnly() in queueDesktopResize() to set/unset the __a0ViewportResizing flag around applyXpraDesktopFrameMode calls - This allows the patched _screen_resized function to permit resizes from the viewport sync flow while maintaining security against accidental resizes Fixes agent0ai#1649
The previous fix was incomplete. This update provides the complete solution:
**Changes:**
1. Properly get client from frame.contentWindow.client (not XPRA_CLIENT.client)
2. Add early return if client not found
3. Set __a0ViewportResizing flag before dimensions sync
4. Sync desktop_width/desktop_height from actual container dimensions
5. Directly call client._screen_resized(new Event('resize')) for proper resize propagation
6. Use try/finally to ensure flag cleanup
**Fixes:** The __a0ViewportResizing flag checked in _screen_resized guard is now both set AND used to drive the actual resize, allowing viewport resizes to propagate through the Xpra flow while blocking accidental resizes.
Fixes agent0ai#1649
_kg_pipeline (88 tests, 1989 lines): - Crash recovery checkpoints (atomic state saves) - Append-only audit trail (JSONL provenance) - LLM-augmented token compression (29%+ reduction) - 5-dimension entity health scoring + tiers - String+LLM entity resolution (504 duplicates merged) _kg_dreamer (48 tests, 3605 lines): - 6 dream operations: connect, strengthen, prune, contradict, pattern, insight - Autonomous background intelligence (runs every 6h) - LLM-powered insight generation via Qwen3.6-35B - Separate plugin for zero-risk rollback Documentation: - KG System Architecture (386 lines) - Entity resolution spike report - Octopoda+OpenHuman enhancement plan v3 Total: 136 tests, 5594 lines, $0 cloud cost
Contributor
|
Hello! Thanks for the PR. Can I ask you if you mind removing usr/plugins and docs directories from the scope of this PR? I have rebased to the |
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.
Fix: Corrected Xpra Desktop Canvas Resize (Fixes #1649)
Problem
The Xpra desktop canvas was not resizing when the browser window was resized.
Root Cause
The
__a0ViewportResizingflag was checked ininstallXpraDesktopClientPatchesbut was only being set via incomplete logic inrefreshFrameOnly. The flag was missing the actual resize propagation logic, causingclient._screen_resized()to never be called during viewport resizes.Solution
This PR provides the complete corrected fix:
Changes in
plugins/_desktop/webui/desktop-store.js_screen_resizedguard (lines 1908-1916):__a0ViewportResizing === trueand allow resizes when the flag is setrefreshFrameOnlylambda (lines 2109-2132) - CORRECTED:frame.contentWindow.clientclient.__a0ViewportResizing = truebefore resizedesktop_widthanddesktop_heightfrom actual container dimensionsclient._screen_resized(new Event("resize"))for proper Xpra resize propagationtry/finallyto ensure flag cleanupHow It Works
Now when the browser window is resized:
refreshFrameOnlysets__a0ViewportResizing = truebefore doing workclient._screen_resized(new Event("resize"))is called directly_screen_resizedsees the flag is set and allows the resizefinally, the flag is clearedThis allows viewport resizes to properly propagate through the Xpra flow while maintaining security against accidental/unexpected resizes.