diff options
Diffstat (limited to 'winit/src')
-rw-r--r-- | winit/src/application.rs | 7 | ||||
-rw-r--r-- | winit/src/settings.rs | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index 3d7c6e5d..1141ba27 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -26,6 +26,7 @@ use crate::{Clipboard, Error, Proxy, Settings}; use futures::channel::mpsc; use std::mem::ManuallyDrop; +use winit::window::WindowLevel; #[cfg(feature = "trace")] pub use profiler::Profiler; @@ -795,7 +796,11 @@ pub fn run_command<A, E>( window.focus_window(); } window::Action::ChangeAlwaysOnTop(on_top) => { - window.set_always_on_top(on_top); + let level = match on_top { + true => WindowLevel::AlwaysOnTop, + false => WindowLevel::Normal, + }; + window.set_window_level(level); } window::Action::FetchId(tag) => { proxy diff --git a/winit/src/settings.rs b/winit/src/settings.rs index be0ab329..413ae64a 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -26,7 +26,7 @@ use crate::core::window::Icon; use crate::Position; use winit::monitor::MonitorHandle; -use winit::window::WindowBuilder; +use winit::window::{WindowBuilder, WindowLevel}; use std::fmt; @@ -121,6 +121,10 @@ impl Window { let (width, height) = self.size; + let window_level = match self.always_on_top { + true => WindowLevel::AlwaysOnTop, + false => WindowLevel::Normal, + }; window_builder = window_builder .with_title(title) .with_inner_size(winit::dpi::LogicalSize { width, height }) @@ -128,7 +132,7 @@ impl Window { .with_decorations(self.decorations) .with_transparent(self.transparent) .with_window_icon(self.icon.and_then(conversion::icon)) - .with_always_on_top(self.always_on_top) + .with_window_level(window_level) .with_visible(self.visible); if let Some(position) = conversion::position( |