dnd.js: Fix window freeze on rapid taskbar clicks #13465
+6
−0
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 #13462
Problem
When users click rapidly on taskbar icons, windows can become unresponsive - clicks inside the window content have no effect until the user clicks on the title bar or maximizes/minimizes the window.
Root Cause
The issue is in
js/ui/dnd.jsin the_onButtonPresshandler. When a button press event occurs, the code calls_grabActor()to grab the pointer for potential drag operations. However, if another click happens before the previous grab is properly released (which can happen during rapid clicking), the grabs accumulate and the pointer gets stuck in a grabbed state.Solution
Before starting a new grab in
_onButtonPress, check if there's already an existing grab (this._onEventIdis set) and clean it up first by calling_ungrabActor(). This ensures only one grab is active at a time and prevents the accumulation that causes the freeze.Changes
_onButtonPressto release any existing grab before creating a new oneTesting