Skip to content

feat: toggle fullscreen with the F key on desktop - #955

Open
Ortes wants to merge 3 commits into
fluttercommunity:masterfrom
Ortes:feat/keyboard-fullscreen-toggle
Open

feat: toggle fullscreen with the F key on desktop#955
Ortes wants to merge 3 commits into
fluttercommunity:masterfrom
Ortes:feat/keyboard-fullscreen-toggle

Conversation

@Ortes

@Ortes Ortes commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds an F keyboard shortcut on the desktop controls (MaterialDesktopControls) that toggles fullscreen — enters if windowed, exits if fullscreen. This complements the existing Esc shortcut (which only exits) and matches the convention of most desktop video players (YouTube, VLC, mpv…).

How

  • One extra branch in _MaterialDesktopControlsState._handleKeyPress for LogicalKeyboardKey.keyF, calling the existing _onExpandCollapse() (which already drives ChewieController.toggleFullScreen()).
  • Gated by chewieController.allowFullScreen, so it's a no-op when fullscreen is disabled.
  • Keyboard shortcuts are desktop-only by construction (AdaptiveControls routes desktop/web platforms to MaterialDesktopControls), consistent with the existing space/arrow/Esc shortcuts.

Tests

test/keyboard_fullscreen_toggle_test.dart covers toggling fullscreen on then off with repeated F presses, and that F is a no-op when allowFullScreen: false.

dart format, flutter analyze lib, and the full flutter test suite (with --test-randomize-ordering-seed random) are clean.

Ortes added a commit to Ortes/chewie that referenced this pull request Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.57%. Comparing base (7a4631c) to head (5249a8b).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #955      +/-   ##
==========================================
+ Coverage   51.21%   57.57%   +6.36%     
==========================================
  Files          25       25              
  Lines        1728     1742      +14     
==========================================
+ Hits          885     1003     +118     
+ Misses        843      739     -104     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Ortes added a commit to Ortes/chewie that referenced this pull request Aug 12, 2026
@Ortes
Ortes force-pushed the feat/keyboard-fullscreen-toggle branch from f6cceab to 5f66af9 Compare August 12, 2026 07:25
@diegotori

Copy link
Copy Markdown
Collaborator

@Ortes you'll have to fix the version conflicts that you made against the changelog for all of your PRs. Thanks.

Ortes added 3 commits August 12, 2026 22:59
Add an F keyboard shortcut to the desktop controls that toggles
fullscreen (respecting allowFullScreen), complementing the existing
Esc-to-exit shortcut.
@Ortes
Ortes force-pushed the feat/keyboard-fullscreen-toggle branch from 5f66af9 to 5249a8b Compare August 12, 2026 21:02
@Ortes

Ortes commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@diegotori Rebased onto master (1.15.0) and the changelog conflict is resolved — my entry now sits under a fresh ## [Unreleased] section, leaving the released 1.15.0 block untouched. CI is green (lint + build on both Flutter 3.41.9 and 3.x) and the PR shows as mergeable again. Thanks!

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