1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Update to to winit 0.28 (#2654)

* Update to winit 0.28

Mac trackpads pinch gestures will now generate `egui::Event::Zoom`

* Update accesskit_winit

* Try to get Android CI green

* Fix wayland compilation

* Add comment about android-activity

* Update changelogs

* Fix call to register_xlib_error_hook
This commit is contained in:
Emil Ernerfeldt
2023-02-04 12:43:43 +01:00
committed by GitHub
parent e4eaf99072
commit 8344e88f8a
10 changed files with 202 additions and 252 deletions

View File

@@ -78,7 +78,6 @@ pub fn build_window<E>(
let mut window_builder = winit::window::WindowBuilder::new()
.with_title(title)
.with_always_on_top(*always_on_top)
.with_decorations(*decorated)
.with_fullscreen(fullscreen.then(|| winit::window::Fullscreen::Borderless(None)))
.with_maximized(*maximized)
@@ -143,7 +142,16 @@ pub fn build_window<E>(
}
}
window_builder.build(event_loop)
let window = window_builder.build(event_loop)?;
use winit::window::WindowLevel;
window.set_window_level(if *always_on_top {
WindowLevel::AlwaysOnTop
} else {
WindowLevel::Normal
});
Ok(window)
}
fn largest_monitor_point_size<E>(event_loop: &EventLoopWindowTarget<E>) -> egui::Vec2 {
@@ -235,7 +243,12 @@ pub fn handle_app_output(
}
if let Some(always_on_top) = always_on_top {
window.set_always_on_top(always_on_top);
use winit::window::WindowLevel;
window.set_window_level(if always_on_top {
WindowLevel::AlwaysOnTop
} else {
WindowLevel::Normal
});
}
}

View File

@@ -363,7 +363,7 @@ mod glow_integration {
// try egl and fallback to x11 glx
#[cfg(target_os = "linux")]
let preference = glutin::display::DisplayApiPreference::EglThenGlx(Box::new(
winit::platform::unix::register_xlib_error_hook,
winit::platform::x11::register_xlib_error_hook,
));
#[cfg(target_os = "macos")]
let preference = glutin::display::DisplayApiPreference::Cgl;