mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 22:00:04 -04:00
Bump MSRV to 1.85 and edition to 2024
This commit is contained in:
@@ -5,7 +5,7 @@ use winit_core::error::{EventLoopError, NotSupportedError};
|
||||
use winit_core::event_loop::ActiveEventLoop as RootActiveEventLoop;
|
||||
|
||||
use crate::{
|
||||
backend, HasMonitorPermissionFuture, MonitorPermissionFuture, PollStrategy, WaitUntilStrategy,
|
||||
HasMonitorPermissionFuture, MonitorPermissionFuture, PollStrategy, WaitUntilStrategy, backend,
|
||||
};
|
||||
|
||||
mod proxy;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
use std::future;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::task::Poll;
|
||||
|
||||
use winit_core::event_loop::EventLoopProxyProvider;
|
||||
|
||||
use super::super::main_thread::MainThreadMarker;
|
||||
use crate::event_loop::runner::WeakShared;
|
||||
use crate::r#async::{AtomicWaker, Wrapper};
|
||||
use crate::event_loop::runner::WeakShared;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct EventLoopProxy(Wrapper<WeakShared, Arc<State>, ()>);
|
||||
|
||||
@@ -6,8 +6,8 @@ use std::sync::Arc;
|
||||
use std::{fmt, iter};
|
||||
|
||||
use dpi::PhysicalSize;
|
||||
use wasm_bindgen::prelude::Closure;
|
||||
use wasm_bindgen::JsCast;
|
||||
use wasm_bindgen::prelude::Closure;
|
||||
use web_sys::{Document, KeyboardEvent, Navigator, PageTransitionEvent, PointerEvent, WheelEvent};
|
||||
use web_time::{Duration, Instant};
|
||||
use winit_core::application::ApplicationHandler;
|
||||
@@ -19,14 +19,14 @@ use winit_core::window::WindowId;
|
||||
|
||||
use super::proxy::EventLoopProxy;
|
||||
use super::state::State;
|
||||
use crate::r#async::DispatchRunner;
|
||||
use crate::backend::{EventListenerHandle, SafeAreaHandle};
|
||||
use crate::event_loop::ActiveEventLoop;
|
||||
use crate::main_thread::MainThreadMarker;
|
||||
use crate::monitor::MonitorHandler;
|
||||
use crate::r#async::DispatchRunner;
|
||||
use crate::web_sys::event::ButtonsState;
|
||||
use crate::window::Inner;
|
||||
use crate::{backend, event, EventLoop, PollStrategy, WaitUntilStrategy};
|
||||
use crate::{EventLoop, PollStrategy, WaitUntilStrategy, backend, event};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Shared(Rc<Execution>);
|
||||
@@ -802,11 +802,7 @@ impl Shared {
|
||||
DeviceEvents::Always => true,
|
||||
DeviceEvents::WhenFocused => {
|
||||
self.0.all_canvases.borrow().iter().any(|(_, canvas, _)| {
|
||||
if let Some(canvas) = canvas.upgrade() {
|
||||
canvas.has_focus.get()
|
||||
} else {
|
||||
false
|
||||
}
|
||||
if let Some(canvas) = canvas.upgrade() { canvas.has_focus.get() } else { false }
|
||||
})
|
||||
},
|
||||
DeviceEvents::Never => false,
|
||||
|
||||
@@ -522,13 +522,8 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||
}
|
||||
|
||||
fn system_theme(&self) -> Option<Theme> {
|
||||
backend::is_dark_mode(self.runner.window()).map(|is_dark_mode| {
|
||||
if is_dark_mode {
|
||||
Theme::Dark
|
||||
} else {
|
||||
Theme::Light
|
||||
}
|
||||
})
|
||||
backend::is_dark_mode(self.runner.window())
|
||||
.map(|is_dark_mode| if is_dark_mode { Theme::Dark } else { Theme::Light })
|
||||
}
|
||||
|
||||
fn set_control_flow(&self, control_flow: ControlFlow) {
|
||||
|
||||
Reference in New Issue
Block a user