Conversation
`mouseOut` called `releaseAllInputs`, which releases the keyboard along with the mouse. Any host UI that holds a sticky modifier — an on-screen Ctrl for a shortcut the OS would otherwise intercept, say — loses it the moment the pointer moves onto an overlay toolbar, because leaving the canvas is exactly what that gesture does. Release the three mouse buttons instead. That is all the original stuck-right-click fix needed: the buttons go up, and keyboard state survives the pointer leaving. Unlike `mouseIn`, there is no trustworthy `event.buttons` to diff against once the pointer is gone, so all three are released unconditionally.
Two capabilities a host embedding the component cannot express today. `sendKey(code, down?)` injects a single key by `KeyboardEvent.code`. Omitting `down` sends press+release; passing a bool drives a sticky modifier. This is how an on-screen Ctrl+Alt+Del button gets implemented without asking the browser for a chord the OS has already taken, and the existing `ctrlAltDel`-style helpers cover only fixed combinations. `desktopScaleFactor(percent)` exposes the CS_CORE DesktopScaleFactor field, so a HiDPI client can ask Windows to scale its own chrome and fonts rather than rendering at native size and being downscaled. Values outside the spec's 100..=500 range fall back to 0 (server default) with a warning; 0 keeps the field omitted, which is the current behaviour.
|
Warning Review limit reachedNext included review available in 14 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
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.
Also split out of #1, independent of #2 (the tearing fix) — the two can land in either order.
One input bug fix and two host-facing APIs, all in the web client. No Termium-specific behaviour.
mouseOutno longer releases the keyboardmouseOutcalledreleaseAllInputs, which releases keyboard state along with the mouse. A host that holds a sticky modifier — an on-screen Ctrl for a shortcut the browser or OS would otherwise swallow — loses it the instant the pointer moves onto an overlay toolbar, since leaving the canvas is precisely what that gesture does.Releasing the three mouse buttons is enough. That is all the original stuck-right-click fix needed, and it leaves keyboard state intact. Unlike
mouseIn, there is no trustworthyevent.buttonsto diff against once the pointer is gone, so all three are released unconditionally.mouseInput.test.tsis updated accordingly: the existing regression test assertedreleaseAllInputsspecifically, and now asserts that every button goes up and that keyboard state is untouched.sendKey(code, down?)Injects a single key by
KeyboardEvent.code. Omittingdownsends press+release; passing a bool drives a sticky modifier.This is how a host implements an on-screen Ctrl+Alt+Del button without asking the browser for a chord the OS has already taken. The existing helpers (
ctrlAltDel,ctrlC, …) only cover fixed combinations, so there is currently no way to send an arbitrary single key.desktopScaleFactor(percent)Exposes the RDP CS_CORE DesktopScaleFactor field, letting a HiDPI client ask Windows to scale its own chrome and fonts instead of rendering at native size and getting downscaled. Pair it with
Math.round(devicePixelRatio * 100)and a HiDPI framebuffer.Values outside the spec's
100..=500range fall back to 0 with a warning; 0 omits the field, which is the current behaviour, so this is opt-in and changes nothing for existing callers.Testing
npm testgreen (19 tests),svelte-check0 errors, prettier and eslint clean across bothiron-remote-desktopandiron-remote-desktop-rdp.cargo clippy --target wasm32-unknown-unknownandcargo fmt --checkclean.sendKeyverified against a Windows host for Ctrl+Alt+Del and for sticky Ctrl held across a click;desktopScaleFactor(200)confirmed to make the server render at 200% chrome scaling.Each change is a separate commit if you would rather take only some of them.