dnd: guard against disposed dragActor in _onAnimationComplete and _dragComplete#13633
Open
timstoop wants to merge 1 commit intolinuxmint:masterfrom
Open
dnd: guard against disposed dragActor in _onAnimationComplete and _dragComplete#13633timstoop wants to merge 1 commit intolinuxmint:masterfrom
timstoop wants to merge 1 commit intolinuxmint:masterfrom
Conversation
…agComplete When Expo closes via hot corner, it destroys Clutter.Group (fake_group) actors that may still be referenced as _dragActor in an active drag. Accessing a finalized GObject causes Gjs-CRITICAL errors and a CPU spin that freezes the desktop. Add is_finalized() checks before accessing the dragActor in both _onAnimationComplete and _dragComplete to bail out gracefully when the actor has already been destroyed by C code. Fixes: linuxmint#13235 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Fixes #13235
When Expo closes via hot corner, it creates and destroys
Clutter.Group(overridden asfake_groupinoverrides.js) actors during the close animation. If a drag is in progress at that moment,dnd.jsstill holds a reference to the now-disposed actor inthis._dragActor. When the drag ends,_onAnimationCompleteand_dragCompleteattempt to access the finalized GObject, triggering Gjs-CRITICAL errors and a CPU spin that freezes the desktop.is_finalized()check in_onAnimationCompleteto bail out gracefully when the drag actor has been destroyed by C code before the animation completedis_finalized()guard in_dragCompletebefore callingutil_set_hidden_from_pickon the drag actorTested on Linux Mint 22.3 / Cinnamon 6.6.7 with dual monitors and NVIDIA RTX 3050. No new
fake_groupdisposed errors in~/.xsession-errorsafter fix, where previously they appeared consistently when using hot corners to trigger Expo.Note: this fix was developed with AI assistance (Claude).