Skip to content

Page-requested fullscreen #30

Description

@mxmgorin

requestFullscreen() is handled by the engine but ignored by us, so a video site's fullscreen button currently does nothing on screen. On these devices, that is likely the first button a user reaches for when a <video> starts playing.

Design

  • Implement WebViewDelegate::notify_fullscreen_state_changed(webview, is_fullscreen) in browser/delegate.rs, alongside the existing notify_* hooks, and keep the state per tab. A background tab entering fullscreen must not hide the chrome of the tab currently on screen.
  • Fullscreen here means hiding the chrome and giving the page the whole window, not calling SDL_SetWindowFullscreen. On a handheld, the window already fills the panel; the toolbar is what costs pixels. The webview rect is the window minus the toolbar strip (ui::toolbar_height), so entering fullscreen is the same resize path already used when the toolbar auto-hides. Reuse that path rather than adding another one.
  • Exiting: B calls WebView::exit_fullscreen(), while the page's own exitFullscreen() arrives through the same notification, so both paths converge in one place. While fullscreen, B must not also navigate back in history.
  • Overlays such as the menu, settings, and OSK should still draw over the page. Opening one should cover fullscreen, not exit it.
  • On desktop, decide whether fullscreen should also call SDL_SetWindowFullscreen. The simplest first pass is no: keep the same behaviour everywhere.

Notes

  • Engine hooks: WebViewDelegate::notify_fullscreen_state_changedwebview_delegate.rs:984; WebView::exit_fullscreenwebview.rs:706.
  • Add a page under tests/pages/ that requests fullscreen on click, so the path can be tested without relying on a video site.

Activity

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

Metadata

Metadata

Assignees

Labels

engineServo integration, rendering, prefsenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions