Skip to content

Fix crash when monitor is disconnected during dock animation - #339

Open
purvansh2003-creator wants to merge 1 commit into
icedman:mainfrom
purvansh2003-creator:fix-null-dash-on-monitor-removal
Open

Fix crash when monitor is disconnected during dock animation#339
purvansh2003-creator wants to merge 1 commit into
icedman:mainfrom
purvansh2003-creator:fix-null-dash-on-monitor-removal

Conversation

@purvansh2003-creator

Copy link
Copy Markdown

Bug: Disconnecting an external monitor while the dock is animating (autohide/fast-forward) crashes with:
TypeError: can't access property "opacity", this.dash is null
at animate (dock.js)
This disables the extension until it's manually re-enabled or the shell is restarted.

Cause: destroyDocks() calls undock()cancelAnimations()destroyDash() in order, but a synchronous animation tick already in progress (recursive _fast_forward loop, or one re-entered mid-call from the runLoop timer) can still reference this.dash after it's been nulled out — a re-entrancy race that ordering alone can't prevent.

Fix: Guard animate() to return early if this.dash is null, and break out of the fast-forward loop if it becomes null mid-iteration.

Repro: Two monitors, autohide enabled, unplug the external display — reliable and immediate crash, confirmed via journalctl --user -b0 -f.

this.dash is nulled by destroyDash() when a monitor is removed,
but an in-flight animate() call (recursive via the fast-forward
loop, or re-entered mid-tick from the animation timer) can still
be executing and throws:
  TypeError: can't access property 'opacity', this.dash is null
This disables the extension until it is manually re-enabled or
the shell is restarted.

Add a guard at the top of animate() and inside the fast-forward
loop so it exits cleanly instead of crashing once this.dash has
been torn down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant