dnd: guard against disposed dragActor in _onAnimationComplete and _dragComplete#13633
dnd: guard against disposed dragActor in _onAnimationComplete and _dragComplete#13633timstoop 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>
|
I can't reproduce this, and using is_finalized() is a hack we should be moving away from using, not using more. Can you apply this commit and try to reproduce the original issue (without your fix here). |
|
Hi @mtwebster, apologies for the slow reply. Quick note before the test results: the base my branch is built on is To reproduce, I replaced the installed The Gjs-CRITICAL still appears: Frame #0 is That said, I hear you on Happy to share more logs, a dconf dump, or try any diagnostic patch you would like. |
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).