Repository navigation
fix: stop a fitted remote display from resizing in a loop - #64
Merged
Merged
Conversation
|
AI review | Looks safe to merge The PR fixes a UI resize loop at 100% zoom by conditionally setting container overflow to hidden when not zoomed in, and adds a test to verify the behavior. No security, malware, or bug issues found. Reviewed 5abc681. AI can be wrong, a maintainer still decides. Comment |
The display container scrolled at every zoom. Fitted to the container at 100%, a pixel of rounding made the display overflow, the scrollbar that appeared shrank the container, the display was refitted smaller, the scrollbar went away and the cycle started again. 75% and 125% were stable because the display stays clear of the edge or always overflows. The container now scrolls only when the display is zoomed in past the fit, which is when there is something to scroll to. Fixes Termix-SSH#51
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.
Fixes #51: since Termix 26.11.1, an RDP session at 100% zoom with automatic resolution keeps growing and shrinking. 75% and 125% are stable.
The display container (
absolute inset-0 overflow-auto) scrolled at every zoom. At 100% the display is fitted to the container edge (fitScale = min(cWidth / w, cHeight / h)), so one pixel of rounding or extra height from the page's styles makes it overflow. The loop:clientWidth, so the resize observer refits the display smallerisSmallChange(#12) only stops resending the size to the server. This loop is the local refit, which is why the Reconnect resize method doesn't help. Below 100% the display stays clear of the edge, and above it it always overflows, so neither flips. A fixed resolution is stable for the same reason.The container now scrolls only when the zoom is past the fit (
zoom > 1). That is the only case with anything to scroll to.applyZoomsets it, so the toolbar zoom, pinch zoom and refits all go through the same place. The container starts asoverflow-hidden.Validation: a new test zooms in and back out through the display handle and checks the container scrolls only while zoomed in. It fails before the change. All 575 plugin tests (1 skipped), typecheck, build, manifest validation and prettier pass. Not reproduced in a browser here; the loop needs the real layout.