Skip to content

[v15] Re-enable and fix sticky windows key#38699

Merged
zmb3 merged 3 commits intobranch/v15from
isaiah/backport-37739-37962-38198-branch/v15
Feb 28, 2024
Merged

[v15] Re-enable and fix sticky windows key#38699
zmb3 merged 3 commits intobranch/v15from
isaiah/backport-37739-37962-38198-branch/v15

Conversation

@ibeckermayer
Copy link
Copy Markdown
Contributor

@ibeckermayer ibeckermayer commented Feb 27, 2024

Backports

to branch/v15

changelog: Re-enabled the Windows key and prevents it from sticking or otherwise causing problems when cmd+tab-ing or alt+tab-ing away from the browser during desktop sessions.

dependabot Bot and others added 3 commits February 27, 2024 12:38
Bumps the rust group with 2 updates: [tokio](https://github.com/tokio-rs/tokio) and [time](https://github.com/time-rs/time).


Updates `tokio` from 1.35.1 to 1.36.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-1.35.1...tokio-1.36.0)

Updates `time` from 0.3.31 to 0.3.34
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](time-rs/time@v0.3.31...v0.3.34)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust
- dependency-name: time
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… IronRDP master commit hash. (#37962)

* Adds the extended keycode where appropriate and updates to the latest IronRDP master commit hash.

* cleaning up disconnect result

* Pipes disconnect messages through to the client.

This required a change to the state management for DesktopSession. State
is still quite complex to get right here, but this is a step in the right
direction.

* Updates desktopPlaybackHandle to the new authenticated websocket paradigm as it was forgotten in #37520

* prettier formatting

* adding clarifying comments

* Further refactoring to make DesktopSession's state machine more comprehensible

* Remove unnecessary items from dependency lists
* Adds the extended keycode where appropriate and updates to the latest IronRDP master commit hash.

* cleaning up disconnect result

* Pipes disconnect messages through to the client.

This required a change to the state management for DesktopSession. State
is still quite complex to get right here, but this is a step in the right
direction.

* Updates desktopPlaybackHandle to the new authenticated websocket paradigm as it was forgotten in #37520

* prettier formatting

* adding clarifying comments

* Further refactoring to make DesktopSession's state machine more comprehensible

* Remove unnecessary items from dependency lists

* Adds the KeyboardHandler class
that manages the keyboard events, including new functionality to handle
withholding the Windows/Alt keys to prevent such keys from "sticking"
when the user switches between windows.

This technique works to stop the sticking, though there is still an edge
case where the user cmd/alt-tabs super quickly, in a manner that the browser
sees both the down and up events for the Windows key, despite the user's
intention being to change windows. In the case of the Windows key, this
causes the start menu to pop open, and the user must press the Windows key
again to close it. This is not a showstopper, but it is a bit annoying.
A similar problem would occur with the Alt key, where such behavior would
cause the current window (on the Windows machine) to focus on the menu bar.

The next commit will be to add a timeout mechanism for the relevant keyup events
in order to mitigate this edge case.

* Adds a delayUp cache for delaying the up event
of the sticky windows key. This is to prevent the edge case
where the user presses cmd/alt-tab really quickly in a manner
that causes the down + up events to be registered in spite of
the user's intention to be to change out of the window.

* Refactoring KeyboardHandler

* Convert caches into Maps

* Moves the rest of keyboard functionality into KeyboardHandler, rearranges methods, adds an onUnmount for clearing all the intervals on unmount

* Moves KeyboardHandler to its own file

* simplifies withholding logic by including a Withholder class with a single array that manages all the withheld keystrokes

* Makes useEffect symmetrical

* Rename onUnmount to dispose

* sp

* Adds unit tests for Withholder

* Splitting Withholder out into its own file

* nits

* CR

* make fix-license
@ibeckermayer ibeckermayer added this pull request to the merge queue Feb 28, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 28, 2024
@ibeckermayer ibeckermayer added this pull request to the merge queue Feb 28, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 28, 2024
@zmb3 zmb3 added this pull request to the merge queue Feb 28, 2024
Merged via the queue into branch/v15 with commit 2e52c95 Feb 28, 2024
@zmb3 zmb3 deleted the isaiah/backport-37739-37962-38198-branch/v15 branch February 28, 2024 06:14
@camscale camscale mentioned this pull request Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants