Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Open Slint Rust App in Fullscreen Mode #7478

Open
Moshyfawn opened this issue Jan 27, 2025 · 4 comments
Open

Unable to Open Slint Rust App in Fullscreen Mode #7478

Moshyfawn opened this issue Jan 27, 2025 · 4 comments
Labels
a:backend-winit Winit backend (mS,mO) bug Something isn't working need triaging Issue that the owner of the area still need to triage

Comments

@Moshyfawn
Copy link

Moshyfawn commented Jan 27, 2025

Bug Description

I've tried multiple approaches to launch the (default Slint + Rust template) app in fullscreen mode, but none of them work:

  1. Setting full-screen: true property on the AppWindow widget
  2. Using ui.window().set_fullscreen(true) in main.rs
  3. Setting the SLINT_FULLSCREEN=1 environment variable (both debug and release builds)

In all cases, the app launches in windowed mode instead of fullscreen, with all window decorations (title bar, close button, etc.) still visible.

This issue occurs on:

  • macOS
  • Linux Ubuntu Wayland (tested in Parallels VM)

Reproducible Code (if applicable)

fn main() -> Result<(), Box<dyn Error>> {
    let ui: AppWindow = AppWindow::new()?;
    ui.window().set_fullscreen(true);
}
export component AppWindow inherits Window {
    full-screen: true;
    VerticalBox { }
}
SLINT_FULLSCREEN=1 cargo run

Environment Details

  • Slint Version: 1.8.0
  • Platform/OS: MacOS 15.2 (24C101) / Ubuntu 22.04.2 ARM64 (Parallels VM)
  • Programming Language: Rust
  • Backend/Renderer: default

Product Impact

  • I'm building an app for device provisioning
  • The app needs to be fullscreen, in a sort of kiosk mode, so it is a blocker in my case
@Moshyfawn Moshyfawn added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Jan 27, 2025
@ogoffart
Copy link
Member

This works for me (both the SLINT_FULLSCREEN=1, and the full-screen: true) On linux/X11
On linux, are you using wayland or x11?

Slint Version: 1.8.0

Can you try with 1.9.2?

@flukejones
Copy link
Contributor

flukejones commented Feb 1, 2025

Fullscreen does not work with wayland at this time. Given that the majority of Linux ecosystem is heading towards being wayland only this might need a little more priority. I see a few usecases:

  • gamescope overlays (for example SteamOS, overlay on top of UI)
  • Use in weston
  • Use in Cage
  • Possible games

Edit: looks like exclusive-fullscreen is not actually supported on wayland: https://docs.rs/winit/latest/winit/window/struct.Window.html#method.set_fullscreen, but slint is defaulting to Borderless anyway.

In Gnome F11 does make the window fullscreen. And checking winit window example, the fullscreen command does work. So somewhere along the line maybe the op is out of order?

In short fullscreen definitely works, the issue is only in startup in fullscreen mode.

@flukejones
Copy link
Contributor

I worked around this with:

let ui_copy = newui.as_weak();
newui
    .window()
    .set_rendering_notifier(move |s, g| {
        if let slint::RenderingState::RenderingSetup = s {
            ui_copy
                .upgrade_in_event_loop(|w| {
                    if !w.window().is_fullscreen() {
                        w.window().set_fullscreen(true)
                    }
                })
                .ok();
        }
    })
    .ok();

which is not ideal. But I think this illustrates the issue. It looks like setting full screen needs to wait until after the window is fully set up?

@ogoffart
Copy link
Member

ogoffart commented Feb 5, 2025

We may need to do something to work around this issue. Like calling set_fullscreen again after show or something like that.

@ogoffart ogoffart added the a:backend-winit Winit backend (mS,mO) label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:backend-winit Winit backend (mS,mO) bug Something isn't working need triaging Issue that the owner of the area still need to triage
Projects
None yet
Development

No branches or pull requests

3 participants