[critical] toggle_settings_screen spawns second ModalScrim while another modal is open #10

Closed
opened 2026-05-19 18:42:00 +00:00 by funman300 · 0 comments
Owner

File

solitaire_engine/src/settings_plugin.rs lines 496–527

Description

toggle_settings_screen flips a resource bool and sync_settings_panel_visibility spawns when it becomes true, guarded only by panels.is_empty(). It does not check whether any other ModalScrim is live. Pressing O or dispatching ToggleSettingsRequestEvent while a Home, Help, Pause, or Profile modal is open produces two concurrent ModalScrim entities and two stacked full-screen overlays.

The Settings panel additionally uses a custom SettingsPanel marker rather than spawn_modal, so ModalScrim-based guards in other systems cannot protect it.

Fix

Add scrims: Query<(), With<ModalScrim>> to sync_settings_panel_visibility and skip spawning when !scrims.is_empty().

## File `solitaire_engine/src/settings_plugin.rs` lines 496–527 ## Description `toggle_settings_screen` flips a resource bool and `sync_settings_panel_visibility` spawns when it becomes true, guarded only by `panels.is_empty()`. It does **not** check whether any other `ModalScrim` is live. Pressing `O` or dispatching `ToggleSettingsRequestEvent` while a Home, Help, Pause, or Profile modal is open produces two concurrent `ModalScrim` entities and two stacked full-screen overlays. The Settings panel additionally uses a custom `SettingsPanel` marker rather than `spawn_modal`, so `ModalScrim`-based guards in other systems cannot protect it. ## Fix Add `scrims: Query<(), With<ModalScrim>>` to `sync_settings_panel_visibility` and skip spawning when `!scrims.is_empty()`.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#10