Skip to content

wayland/screencopy: avoid crash when capturing null screen - #1269

Open
imalbi wants to merge 1 commit into
quickshell-mirror:masterfrom
imalbi:fix/screencopy-null-screen
Open

imalbi wants to merge 1 commit into
quickshell-mirror:masterfrom
imalbi:fix/screencopy-null-screen

Conversation

@imalbi

@imalbi imalbi commented Oct 6, 2026

Copy link
Copy Markdown

Overview

Avoid null pointer dereference crashes when attempting to capture screencopy on a null screen (e.g. Quickshell.screens[0] when no screens are connected or during DRM hotplug/reconnect).

Details

  • Check that screen->screen != nullptr in ScreencopyManager::createContext().
  • Check that screen != nullptr before calling screen->handle() in IccOutputSourceManager::captureOutput() and WlrScreencopyManager::captureOutput().
  • Returning nullptr lets ScreencopyView warn and idle safely until a valid screen is connected and re-evaluated by QML.

Requirements

• I have read and agree with the contributing guidelines https://github.com/quickshell-mirror/quickshell/blob/master/CONTRIBUTING.md

Prevent null pointer dereference in IccOutputSourceManager, WlrScreencopyManager, and ScreencopyManager when captureSource references a null screen.
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