Skip to content

feat(cli): add --maximized and --fullscreen flags to start the window in that mode#66

Merged
roramirez merged 1 commit into
mainfrom
feat/startup-window-mode
Jul 12, 2026
Merged

feat(cli): add --maximized and --fullscreen flags to start the window in that mode#66
roramirez merged 1 commit into
mainfrom
feat/startup-window-mode

Conversation

@roramirez

Copy link
Copy Markdown
Owner

Summary

Add launch-time --maximized and --fullscreen flags so the window can be
started in a specific mode regardless of the configured window size. Parsing
follows the existing hand-rolled --scope style (no new dependency).

Changes

  • src/cli.rs — new StartupWindowMode { Maximized, Fullscreen } enum and
    startup_window_mode() parser. --fullscreen takes precedence over
    --maximized when both are given. Both flags are documented in --help.
  • src/main.rs — new App.startup_window field; App::new takes the parsed
    mode and main() reads it from argv.
  • src/winit_handler.rsresumed() applies fullscreen / maximized to the
    WindowAttributes when the flag is set, overriding the config inner size.
  • Tests — parse matrix (--maximized, --fullscreen, absent), precedence
    (fullscreen wins either order), independence from --scope, and updated help-text
    assertions.
  • CHANGELOG — entry under Added.

How to test

  1. cargo run -- --maximized — window opens maximized.
  2. cargo run -- --fullscreen — window opens fullscreen.
  3. cargo run -- --maximized --fullscreen — opens fullscreen (documented precedence).
  4. cargo run -- --help — lists both flags.
  5. cargo test startup_window_mode covers the parser.

… in that mode

Introduce launch-time flags to force the window mode regardless of the config
window size, mirroring the existing hand-rolled arg parsing.

- add `StartupWindowMode` and `startup_window_mode()` to `cli.rs`; `--fullscreen`
  wins over `--maximized` when both are present
- thread the parsed mode through `App::new` and apply it to the
  `WindowAttributes` in `resumed()` (overrides the config inner size)
- document both flags in `--help`
- tests for the parse matrix, precedence, and independence from `--scope`
@roramirez roramirez marked this pull request as ready for review July 12, 2026 22:03
@roramirez roramirez merged commit 5601100 into main Jul 12, 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.

1 participant