Skip to content

fix(widgets): don't respawn widgets destroyed by game mode suspension - #1865

Merged
eythaann merged 1 commit into
eythaann:masterfrom
z1pp090:fix/game-mode-no-respawn
Sep 28, 2026
Merged

eythaann merged 1 commit into
eythaann:masterfrom
z1pp090:fix/game-mode-no-respawn

Conversation

@z1pp090

@z1pp090 z1pp090 commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Problem

With Suspend widgets on Game Mode enabled, the toolbar and dock come back about a second after a fullscreen game starts and stay on top of it.

WidgetManager::suspend_all() sets GAME_MODE_ACTIVE and clears every pod, which drops the webviews. Each webview's WindowEvent::Destroyed handler in widgets/loader.rs then runs reconcile() + start_all_webviews() unconditionally, so every widget gets recreated right away, in the middle of game mode.

Log with 2.8.6 (Age of Empires II DE, borderless fullscreen):

[18:57:23][TRACE][seelen_ui::modules::power::application] Power mode changed to GameMode
[18:57:24][TRACE][@seelen/fancy-toolbar?monitorId=...] status changed to: Creating
[18:57:24][TRACE][@seelen/fancy-toolbar?monitorId=...] status changed to: Mounting
[18:57:24][TRACE][@seelen/fancy-toolbar?monitorId=...] status changed to: Creating
[18:57:24][TRACE][@seelen/fancy-toolbar?monitorId=...] status changed to: CrashedOnCreation
[18:57:25][TRACE][@seelen/fancy-toolbar?monitorId=...] status changed to: Creating
[18:57:26][TRACE][@seelen/fancy-toolbar?monitorId=...] status changed to: Ready

This looks like the same root cause as #1565 (widgets reappearing and stealing focus from fullscreen games with this setting on).

Fix

Skip the respawn in the Destroyed handler while GAME_MODE_ACTIVE is set. reconcile() still runs, so the pods are recreated in Pending and resume_all() starts them when game mode ends, as before.

Testing

Tested on Windows 11 with a local debug build of this branch, two monitors, same game:

  • Entering game mode: toolbar and dock pods are dropped and not recreated; no bar over the game.
  • Leaving game mode: toolbar and dock go Creating → Mounting → Ready within ~2 s on both monitors.

CI passed on the fork. Not tested: exclusive-fullscreen games, lazy widgets, or a monitor being connected/disconnected while game mode is active.

🤖 Generated with Claude Code

suspend_all() clears every pod when game mode starts, which destroys the
webviews. The Destroyed handler then called start_all_webviews()
unconditionally, so the toolbar and dock came back a second later on top
of the fullscreen game. Skip the respawn while GAME_MODE_ACTIVE is set;
resume_all() starts them again when game mode ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Widget respawn logic now checks game mode state.

The PR appears safe to merge based on the reviewed widget suspension and resume paths.

Summary

The PR prevents the Destroyed handler from immediately restarting non-lazy widgets while game-mode suspension is active. Reconciliation still prepares pods for the existing resume path.

Reviews (1) · Last reviewed commit: "fix(widgets): don't respawn widgets dest..."

@eythaann
eythaann enabled auto-merge (squash) September 27, 2026 19:56
@eythaann
eythaann disabled auto-merge September 28, 2026 08:35
@eythaann
eythaann merged commit 5cf411b into eythaann:master Sep 28, 2026
2 checks passed
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.

2 participants