Skip to content

Remember the native window and add GNOME Wayland caption buttons - #1407

Open
abdallah-shehawey wants to merge 6 commits into
storytold:mainfrom
abdallah-shehawey:codex/window-state-restoration
Open

abdallah-shehawey wants to merge 6 commits into
storytold:mainfrom
abdallah-shehawey:codex/window-state-restoration

Conversation

@abdallah-shehawey

@abdallah-shehawey abdallah-shehawey commented Oct 26, 2026 •

Copy link
Copy Markdown

Windows should reopen at their last normal size, or maximized, at any interface size (150% included), and Restore after a maximized restart should return to the last normal size. On GNOME Wayland, where the compositor draws no frame, a native Wayland window (DECKCRAFT_WAYLAND=1; by default DeckCraft opens through XWayland, where GNOME draws the frame) also needs caption buttons.

Changes:

  • Pin the Craft egui family to Fix window restoration across UI zoom and enable GNOME Wayland controls egui#3 (69750b7, on the 0.37 migration branch). That change stores the interface zoom with the saved geometry, keeps the last normal rectangle while the window is maximized, repeats a requested maximize once X11 has mapped the window, and enables winit's font-free Adwaita caption buttons on Wayland. NOTICE carries sctk-adwaita's MIT licence where it wasn't already, and the provenance links of egui's default fonts follow the new pin.
  • Enable eframe's persistence feature so the native window is saved. egui's widget memory stays out of eframe's storage (persist_egui_memory returns false): preferences keep their own store.
  • Progress log, revision tables and status lines in ROADMAP.md and docs/ui-parity.md.
  • contributors/people.toml: an entry for @abdallah-shehawey with the public GitHub name.

Depends on storytold/egui#3. Until it merges, the pinned revision resolves through that PR's ref.

Validation, on Fedora 44 (GNOME 50, x86_64):

  • cargo xtask ci: all 8 steps passed (fmt, pdf-deps, clippy, test, doctest, assets, layers, wasm), with CRAFT_FONTS_DIR set to a craft-fonts checkout.
  • The shared change was exercised natively at 150% (Fix window restoration across UI zoom and enable GNOME Wayland controls egui#3): three normal and three maximized reopens at the same geometry, Restore to the last normal size after a maximized restart, and real clicks on minimize, maximize, restore and close under GNOME 50 Wayland.
  • Not run on macOS or Windows.

Overlap: #842 turns on the same font-free Adwaita frame in DeckCraft's own manifest. Here it comes through the shared egui pin for every Craft app; either can land first, and together they are harmless.

Update, 26 Oct (55c187b):

  • Merged main. Conflicts: ROADMAP.md, contributors/people.toml keep both sides.
  • The egui pin moves to Fix window restoration across UI zoom and enable GNOME Wayland controls egui#3's new head, 69750b7. eframe now drops its storage, which joins the pending write, after the last save and before App::on_exit, so an app that ends the process there (GridCraft does on macOS) no longer loses the window it just saved. persist_window = false now also skips restoring a window saved by an earlier run; before, it only stopped the writes.
  • No-preferences (DECKCRAFT_NO_PREFS) and control-channel (--control) runs set persist_window = false, so they neither restore nor save the native window, and control-channel screenshots start from the same window every time.
  • Where the GNOME Wayland caption buttons appear, in this text, ROADMAP.md and docs/ui-parity.md: on a native Wayland window (DECKCRAFT_WAYLAND=1); by default DeckCraft opens through XWayland, where GNOME draws the frame.
  • cargo xtask ci on 55c187b6: all 8 steps passed (fmt, pdf-deps, clippy, test, doctest, assets, layers, wasm), on Fedora 44 with CRAFT_FONTS_DIR set to a craft-fonts checkout.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Windows restore their previous size and maximized state after restarting, including when the interface size has changed. This is available when preferences are enabled and no control port is configured.
    • Native GNOME Wayland windows can show standard minimize, maximize, and close buttons on supported setups when Wayland mode is enabled.

The final 30 Oct follow-up only rearranges contribution metadata to avoid conflicts with newer upstream entries. Parsed contributor data and runtime sources are unchanged; the validation above remains the applicable evidence.

Pin the egui family to storytold/egui#3 (ba04bd7): saved geometry keeps its interface zoom, the last normal rectangle survives maximizing, X11 startup maximize is repeated after mapping, and GNOME Wayland gets Adwaita caption buttons. Enable eframe persistence for the native window, keeping egui widget memory out of it. NOTICE, attribution links, progress docs and the contributor entry are updated.

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between a8223ea and 19f9ffa.

Files selected for processing: 1
  • contributors/people.toml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The PR updates egui dependency revisions and attribution, configures eframe window persistence, adds a contributor entry, and records window restoration and GNOME Wayland caption-button changes.

Changes: egui and window updates

Layer / File(s) Summary
Dependency revisions and attribution
Cargo.toml, ATTRIBUTION.md, NOTICE
The egui crate patches and font source reference use a new revision. NOTICE adds sctk-adwaita 0.10.1 attribution and license details.
Window persistence and change records
apps/deckcraft/Cargo.toml, apps/deckcraft/src/main.rs, ROADMAP.md, docs/ui-parity.md
The app enables eframe persistence, disables egui-memory persistence, and enables window persistence only when DECKCRAFT_NO_PREFS is unset and no control port is configured. The project records describe window restoration and GNOME Wayland caption buttons.

Contributor metadata

Layer / File(s) Summary
Contributor entry
contributors/people.toml
The contributor list adds abdallah-shehawey with GitHub-name synchronization enabled.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 19f9f

No actionable merge-blocking risk is established; the change is mergeable with normal platform validation.

Security architecture risk: Low · up to 19f9f

The visible change concerns local desktop window state, not expanded service privileges. Explicit controls disable window persistence for no-preferences and control-channel runs. Risk remains low rather than minimal because the pinned dependency’s persistence enforcement and shutdown behavior could not be verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated scope is the native desktop application's startup, UI dependency, and persisted window state. The routing signal does not establish an IAM, secret, or service-authority expansion. Dependency-internal storage handling remains outside the verified scope.

Trust Boundaries and Controls

  • observed — Process startup inputs select whether native-window persistence is requested. Presence of DECKCRAFT_NO_PREFS disables that request and separately bypasses application preference loading and saving; a configured control port disables only the window-persistence request.
Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the two main changes: native window state restoration and GNOME Wayland caption buttons.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

abdallah-shehawey and others added 2 commits October 26, 2026 11:37
…restoration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repin the egui family to storytold/egui#3's new head (69750b7): eframe now
drops its storage, joining the pending write, after the last save and before
App::on_exit, so an app that ends the process there no longer loses the
window it just saved; and persist_window = false no longer restores a window
saved by an earlier run.

No-preferences and control-channel runs set persist_window = false, so they
neither restore nor save the native window and control-channel screenshots
start from the same window every time.

The GNOME Wayland caption-button notes now say where they appear: on a
native Wayland window (DECKCRAFT_WAYLAND=1), since the app opens through
XWayland by default and GNOME draws that frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Harrison-Booth

Copy link
Copy Markdown
Contributor

Review notes (read the diff; nothing run beyond formatting).

  • cargo fmt --check is clean on this branch. I did not build or run the app.
  • The Rust side is small (persistence feature, persist_window off for DECKCRAFT_NO_PREFS or a control port, persist_egui_memory false). The window-restore and GNOME caption-button logic is in the egui fork bump (rev 69750b71 in Cargo.toml, Fix window restoration across UI zoom and enable GNOME Wayland controls egui#3); that commit exists on GitHub, but I did not review its diff, so that part is unreviewed.
  • The PR text says it was checked on Linux only. Windows restore at 150% scaling, macOS, and GNOME Wayland caption buttons were not checked by me; WSLg's compositor is not GNOME, so it would not be representative.
  • The Cargo.toml feature line is also edited by fix(clipboard): paste from other apps again on the desktop #1419 (adds clipboard); whichever merges second will need to keep both features.

abdallah-shehawey and others added 3 commits October 27, 2026 19:15
Retain the upstream craft-libs revision 92d392c and module refactors while keeping the window-restoration egui revision 69750b7 until storytold/egui#3 lands.

Validation: Full cargo xtask ci passed all eight steps: fmt, PDF dependency policy, workspace Clippy, tests (2116 pass results), doctests, assets, layers and 23-crate WASM check on Linux.

Co-authored-by: Codex <noreply@openai.com>
Keep the integration note in the existing progress log and revision table. Markdown whitespace checked; runtime sources are unchanged from the validated integration parent.

Co-authored-by: Codex <noreply@openai.com>
Retain the existing contribution records away from the shared upstream insertion points. Move only my own opt-in record; the parsed contributor data and all runtime sources remain unchanged.

Co-authored-by: Codex <noreply@openai.com>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReviewerA — source-read COMMENT (not an approval)

I read the head of the diff: the native window is remembered and GNOME Wayland caption buttons are added. The ATTRIBUTION.md row for the bundled egui icon fonts changes the egui revision from 6d518fc7 to 69750b71, so the dependency source moved, and the lock gains enumn and serde-related entries. Moving the egui revision is a dependency decision, the font provenance rows must stay accurate for the new revision (the same fonts, the same licences), and the Wayland decorations question (craft-launcher#489, deckcraft#90) applies again. Remembering the window position on Wayland is not possible (the protocol hides positions), so only the size can be restored there. I have not run it, and no exact-head CI result exists for this head. Nothing was run.

I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.

Status: waiting_author.

@aiongg aiongg added missing feature The reference application has it and we do not, or only part of it needs decision Needs a product or scope decision by a maintainer labels Nov 4, 2026

@aiongg aiongg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated review (Opus). Not a maintainer decision.

Changes needed:

This enables eframe's window persistence and repins the egui family to a fork commit that restores window size and maximized state across interface zoom and turns on Adwaita caption buttons on Wayland. The DeckCraft code is small; the behaviour comes from the pinned egui commit.

  • apps/deckcraft/src/main.rs:41-43: turning off egui memory persistence keeps widget state out of eframe storage, and the preferences keep their own store.
  • apps/deckcraft/src/main.rs:238: persistence is off for DECKCRAFT_NO_PREFS and control-port runs, which keeps control-channel screenshots reproducible. Skipping the restore of an earlier saved window depends on the pinned egui commit, not on code in this repository.
  • Cargo.toml:110-123 pins every egui crate to 69750b71, a commit from an open egui pull request whose head has since moved. The other Craft repositories still pin 6d518fc7, so this repository would build against a different egui until that change lands and the pins are moved together.
  • The window-restore, zoom and maximize logic and the Adwaita frame can't be reviewed from this diff; they live entirely in the egui commit.
  • ROADMAP.md:140 and ROADMAP.md:299 add a 'Reconcile the current upstream modules' row. That records a branch merge rather than a change in behaviour, and could be dropped.
  • NOTICE:107 adds the sctk-adwaita licence. Another open change adds the same frame and notice in apps/deckcraft/Cargo.toml, so the two would need reconciling to avoid a duplicate notice.
  • With the default display choice (apps/deckcraft/src/display.rs:36-42) the window opens on X11 when an X server is running, so the caption buttons only appear with DECKCRAFT_WAYLAND=1 or without XWayland. The description says so.

Claims checked:

  • verified: The Craft egui family is pinned to 69750b7 and the egui font provenance links follow the new pin (Cargo.toml:110-123 set every egui crate to rev 69750b71…; ATTRIBUTION.md:46 points the icon-font source at the same revision)
  • unverified: Windows reopen at their last normal size or maximized at any interface size, and Restore after a maximized restart returns to the last normal size (The only DeckCraft change is the eframe 'persistence' feature at apps/deckcraft/Cargo.toml:17. The zoom-aware save and restore, normal-rectangle tracki…
  • verified: egui widget memory stays out of eframe storage; preferences keep their own store (apps/deckcraft/src/main.rs:41-43 returns false from persist_egui_memory; preferences still go through load_prefs and save_prefs at apps/deckcraft/src/main.rs:86-107)
  • unverified: No-preferences and control-channel runs neither restore nor save the native window (apps/deckcraft/src/main.rs:238 sets persist_window to false when DECKCRAFT_NO_PREFS or a control port is set. Whether false also skips the restore depends on eframe code in the pinned egui commit, which is not in th…
  • unverified: Native GNOME Wayland windows (DECKCRAFT_WAYLAND=1) get minimize, maximize and close buttons; by default DeckCraft opens through XWayland (No DeckCraft code enables the frame; it would come from the pinned egui commit. The default is X11 whenever an X server is running and Wayland only when forced o…
  • verified: NOTICE carries sctk-adwaita's MIT licence (NOTICE:107-131 add the sctk-adwaita 0.10.1 heading and the MIT licence text)
  • verified: Progress log, revision tables and status lines are updated in ROADMAP.md and docs/ui-parity.md (ROADMAP.md:5, :140-141 and :299-300 and docs/ui-parity.md:3 and :172 add the entries. ROADMAP.md:140 and :299 also add a row about reconciling upstream modules that does not describe a behaviour change)
  • verified: contributors/people.toml gains an entry for the author with the public GitHub name (contributors/people.toml:25-26 adds [people.abdallah-shehawey] with sync_github_name = true)

Recommendation: update the pull request; it will be reviewed again.

Reviewed at 19f9ffa.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing feature The reference application has it and we do not, or only part of it needs decision Needs a product or scope decision by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants