Skip to content

Sync downstream fix: prevent crash from stale fullscreen pointer in overview mode#9014

Open
anonymous0719 wants to merge 1 commit intoswaywm:masterfrom
anonymous0719:scroll-pr1
Open

Sync downstream fix: prevent crash from stale fullscreen pointer in overview mode#9014
anonymous0719 wants to merge 1 commit intoswaywm:masterfrom
anonymous0719:scroll-pr1

Conversation

@anonymous0719
Copy link
Copy Markdown

Background

We are developing a research tool that scans downstream forks to identify valuable commits
that have not yet been merged back into upstream projects.
The goal is to help upstream maintainers discover useful fixes that may otherwise remain
isolated in forks.

During this process, we found this commit in a downstream fork, and it has already been
validated and merged there.

What this change does

This commit fixes a crash that occurs when a fullscreen container is destroyed while the
system is in overview mode.

Root cause

When a fullscreen container is closed in overview mode, the workspace layout may still keep
a reference to that container in layout.fullscreen.
This creates a stale (dangling) pointer, which can later be dereferenced when exiting
overview mode, leading to a crash.

Fix

The patch explicitly clears the fullscreen reference when:

  • the container being destroyed
  • is the same container stored in the overview layout fullscreen state

This prevents stale pointers and avoids invalid memory access.

Why this matters

This issue is:

The fix is minimal, safe, and localized, and has already been proven in a downstream fork.

Additional context

This PR is part of our effort to upstream valuable downstream contributions discovered via
our analysis tool.
All commits are manually reviewed and technically validated before submission.

We hope this contribution is helpful.
If there are any concerns about the change itself or suggestions on how our tool or workflow
could be improved, we would greatly appreciate your feedback.


Related issue: #125
Downstream reference commit: f42701e

…iner

When a fullscreen container is destroyed while in overview mode, the workspace
layout may still keep a stale fullscreen pointer, leading to invalid memory
access and crashes when exiting overview.

This change clears the fullscreen reference if the destroyed container is the one
stored in the overview layout, preventing use-after-free and crash scenarios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants