Update to winit 0.28

This commit is contained in:
Nico Burns 2023-02-27 23:44:31 +00:00
parent cf434236e7
commit a5fbfe7ea5
3 changed files with 16 additions and 7 deletions

View file

@ -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

View file

@ -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(