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

@ -23,14 +23,14 @@ wayland-dlopen = ["winit/wayland-dlopen"]
wayland-csd-adwaita = ["winit/wayland-csd-adwaita"]
[dependencies]
window_clipboard = "0.2"
window_clipboard = { git = "https://github.com/TobTobXX/window_clipboard", rev = "1392da8339c8aebb9849d00eb7383a73ed076f1d" }
log = "0.4"
thiserror = "1.0"
[dependencies.winit]
version = "0.27"
git = "https://github.com/iced-rs/winit.git"
rev = "940457522e9fb9f5dac228b0ecfafe0138b4048c"
version = "0.28"
git = "https://github.com/nicoburns/winit.git"
rev = "f160dc321eaa2e30f770f0b61f7ffc74541cafe0"
default-features = false
[dependencies.iced_runtime]

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(