-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Reset modifier button's state #12187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.22
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where modifier keys (Shift, Ctrl, Alt, Windows) remain stuck in the pressed state on VMware VMs when the browser tab/window closes unexpectedly, particularly when using a websocket reverse proxy. The solution adds event handlers to detect tab closure and release all pressed modifier keys before the connection is terminated.
Key changes:
- Introduces a centralized
_modifierKeysconfiguration object mapping modifier keys to their keysyms, codes, and button IDs - Adds
beforeunloadandpagehideevent listeners to detect tab/window closure - Implements helper methods to release individual or all pressed modifier keys
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12187 +/- ##
============================================
+ Coverage 3.58% 17.56% +13.97%
- Complexity 0 15548 +15548
============================================
Files 445 5910 +5465
Lines 37536 529129 +491593
Branches 6905 64634 +57729
============================================
+ Hits 1346 92939 +91593
- Misses 36024 425732 +389708
- Partials 166 10458 +10292
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15916 |
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm, one question.
also tested ok in lab env |
c98f72a to
e05b970
Compare
Description
Fixes #9940
Copilot Generated summary
This pull request enhances the reliability of modifier key handling in the noVNC UI, especially for VMware VMs using a websocket reverse proxy. It introduces logic to ensure all pressed modifier keys are released when the user closes the browser tab or navigates away, preventing stuck keys on the remote VM. The changes are grouped into modifier key management and event handling improvements.
Modifier key management:
_modifierKeysconfiguration object to track modifier keys (Shift, Ctrl, Alt, Windows) and their associated keysyms, codes, and button IDs in theUIobject._sendKeyUp,_releaseModifierKey, and_releaseAllModifierKeysmethods to send key release events for individual or all modifier keys, updating UI state accordingly.Event handling improvements:
beforeunloadandpagehideevent listeners to trigger modifier key release logic when the user closes the tab or navigates away, ensuring the remote VM does not retain stuck modifier keys.handleBeforeUnloadandhandlePageHidemethods to execute modifier key release logic on relevant browser events.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?