You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create an app that has a fullscreen overlay window. set_fullscreen is not useful for me, because it opens the window in another space and it doesn't cover the menubar/notch.
And even though it is not opened as a new space, again, it doesn't cover the menu bar/notch.
Also tried creating the backend with attrs:
slint::BackendSelector::new().backend_name("winit".into()).with_winit_window_attributes_hook(move |attrs| {use winit::platform::macos::WindowAttributesExtMacOS;
attrs
// No title bar, no traffic lights, no system chrome..with_decorations(false)// Prevent the user from resizing via the window edge..with_resizable(false)// Extend content area behind system UI / notch..with_fullsize_content_view(true)// Hide the title text (redundant with decorations=false, but explicit)..with_title_hidden(true)// Provide the initial inner-size matching the full screen..with_inner_size(winit::dpi::LogicalSize::new(logical_w, logical_h))// Place the window at the screen origin (covers notch corner)..with_position(winit::dpi::LogicalPosition::new(origin_x, origin_y))}).select()?;// where size and position are the exact monitor size and position.
Didn't work.
Also tried getting the ns_window and modifying things from there:
// --- Window level: screensaver (above menus, dock, everything) ---
ns_window.setLevel(SCREENSAVER_WINDOW_LEVEL);// --- Collection behavior ---// CanJoinAllSpaces → visible on every virtual desktop / Space// Stationary → doesn't move when Spaces switch// IgnoresCycle → excluded from Cmd+Tab and Mission Control// FullScreenNone → opt out of macOS native fullscreen tile/space mechanismlet behavior = NSWindowCollectionBehavior::CanJoinAllSpaces
| NSWindowCollectionBehavior::Stationary
| NSWindowCollectionBehavior::IgnoresCycle
| NSWindowCollectionBehavior::FullScreenNone;
ns_window.setCollectionBehavior(behavior);// --- Style mask: borderless + full-size content view ---// FullSizeContentView extends the content area behind any system chrome and into the// display's "safe-area" (covering the notch on modern MacBooks).// Borderless = 0; FullSizeContentView is the relevant flag for notch coverage.let mask = NSWindowStyleMask::Borderless | NSWindowStyleMask::FullSizeContentView;
ns_window.setStyleMask(mask);// Keep the window visible even when the app loses focus.
ns_window.setHidesOnDeactivate(false);// Remove the drop-shadow around the overlay.
ns_window.setHasShadow(false);// Prevent the user from dragging the overlay.
ns_window.setMovable(false);// --- Size the window to cover the full screen (in points) ---
ns_window.setFrame_display(screen_frame,true);
Also, I tried as well to set the width and height in the .slint file to a property that I then set from rust (set_monitor_[width/height] properties). But again, nothing. Unless there is a way I never tried, I don't know how to achieve this.
And some things work, like setting the level to the screen saver (level 1000), because no other window or even the dock displays above it, BUT the size is still below the macOS menu bar/notch.
This is very easy to achieve if I use winit only; there is not much work to do, just getting the ns_window and setting the level, etc., but it is impossible with Slint.
Slint seems to be overriding anything I do with the window.
On Windows it is very easy to achieve this, but on macOS it has been impossible for me. Hope you can help me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create an app that has a fullscreen overlay window.
set_fullscreenis not useful for me, because it opens the window in another space and it doesn't cover the menubar/notch.These (WindowExtMacOS):
And even though it is not opened as a new space, again, it doesn't cover the menu bar/notch.
Also tried creating the backend with attrs:
Didn't work.
Also tried getting the
ns_windowand modifying things from there:Also, I tried as well to set the width and height in the
.slintfile to a property that I then set from rust (set_monitor_[width/height] properties). But again, nothing. Unless there is a way I never tried, I don't know how to achieve this.And some things work, like setting the level to the screen saver (level 1000), because no other window or even the dock displays above it, BUT the size is still below the macOS menu bar/notch.
This is very easy to achieve if I use winit only; there is not much work to do, just getting the
ns_windowand setting the level, etc., but it is impossible with Slint.Slint seems to be overriding anything I do with the window.
On Windows it is very easy to achieve this, but on macOS it has been impossible for me. Hope you can help me.
I am using Slint 1.15.1.
Beta Was this translation helpful? Give feedback.
All reactions