Repository navigation
Conversation
…valid FramedBackground captured the primary monitor index once at construction. When the monitor layout changes afterwards (e.g. closing a laptop lid with an external monitor attached) the stored index can point to a monitor that no longer exists. meta_display_get_monitor_geometry () then fails its precondition and leaves the out rect uninitialized, so the workspace background got a garbage size and ShadowEffect crashed while allocating and filling a texture for it when opening the multitasking view. - BackgroundManager: make monitor_index settable, rebuild the background when it changes and never use the geometry of an invalid monitor. - FramedBackground: follow the primary monitor on monitors-changed. - ShadowEffect: skip drawing the shadow for sizes the texture generation can't handle instead of writing out of bounds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Using LLMs for coding goes against our contributor guide here: https://docs.elementary.io/contributor-guide/development/generative-ai-policy |
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.
Fixes #2977
Issue:
Logging into a Wayland session on a laptop with an external monitor set as the primary display and both screens enabled makes Gala save the primary monitor's
monitor_indexin each workspace'sFramedBackground, the framed wallpaper shown behind each workspace in the multitasking view.However, if the laptop lid is closed and its screen is turned off, Mutter renumbers the remaining monitors, making the index saved in Gala outdated as it points to a monitor that no longer exists. When the background is rebuilt for the new monitor layout, it uses that outdated index to ask Mutter for the monitor's size. Mutter rejects it and leaves the size uninitialized, so the background ends up with a garbage size.
Since the ShadowEffect drawn around the background relies on its size to allocate a texture for the shadow, opening the multitasking view with a garbage size can crash the session.
Fix
This change fixes the issue by making the workspace backgrounds in the multitasking view (
FramedBackground) follow the primary display. Theirmonitor_indexis now settable and is updated whenever Mutter reports a monitor change. As safety nets, the background no longer uses the size of a monitor index that doesn't exist, andShadowEffectskips drawing the shadow for sizes it can't handle instead of crashing the session.Changes
monitor_indexis now settable. Changing it rebuilds the background actor, and the geometry of an invalid monitor index is never used (no size, position or rounded clip from an uninitialized rect).monitors-changedand keeps its shadow'smonitor_scalein sync.< 2 * (shadow_size + border_radius)) or larger than 16384, instead of writing out of bounds.Testing
meson testpasses (6/6 with--num-processes 1; in parallelSetupTestcan fail to lockwayland-1, which is unrelated).