mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Remove generic parameter T from EventLoopWindowTarget (#3298)
This commit is contained in:
@@ -272,9 +272,9 @@ impl EventState {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EventLoop<T: 'static> {
|
||||
pub struct EventLoop<T> {
|
||||
windows: Vec<(Arc<RedoxSocket>, EventState)>,
|
||||
window_target: event_loop::EventLoopWindowTarget<T>,
|
||||
window_target: event_loop::EventLoopWindowTarget,
|
||||
user_events_sender: mpsc::Sender<T>,
|
||||
user_events_receiver: mpsc::Receiver<T>,
|
||||
}
|
||||
@@ -315,7 +315,6 @@ impl<T: 'static> EventLoop<T> {
|
||||
destroys: Arc::new(Mutex::new(VecDeque::new())),
|
||||
event_socket,
|
||||
wake_socket,
|
||||
p: PhantomData,
|
||||
},
|
||||
_marker: PhantomData,
|
||||
},
|
||||
@@ -467,10 +466,10 @@ impl<T: 'static> EventLoop<T> {
|
||||
|
||||
pub fn run<F>(mut self, mut event_handler_inner: F) -> Result<(), EventLoopError>
|
||||
where
|
||||
F: FnMut(event::Event<T>, &event_loop::EventLoopWindowTarget<T>),
|
||||
F: FnMut(event::Event<T>, &event_loop::EventLoopWindowTarget),
|
||||
{
|
||||
let mut event_handler =
|
||||
move |event: event::Event<T>, window_target: &event_loop::EventLoopWindowTarget<T>| {
|
||||
move |event: event::Event<T>, window_target: &event_loop::EventLoopWindowTarget| {
|
||||
event_handler_inner(event, window_target);
|
||||
};
|
||||
|
||||
@@ -677,7 +676,7 @@ impl<T: 'static> EventLoop<T> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn window_target(&self) -> &event_loop::EventLoopWindowTarget<T> {
|
||||
pub fn window_target(&self) -> &event_loop::EventLoopWindowTarget {
|
||||
&self.window_target
|
||||
}
|
||||
|
||||
@@ -717,7 +716,7 @@ impl<T> Clone for EventLoopProxy<T> {
|
||||
|
||||
impl<T> Unpin for EventLoopProxy<T> {}
|
||||
|
||||
pub struct EventLoopWindowTarget<T: 'static> {
|
||||
pub struct EventLoopWindowTarget {
|
||||
control_flow: Cell<ControlFlow>,
|
||||
exit: Cell<bool>,
|
||||
pub(super) creates: Mutex<VecDeque<Arc<RedoxSocket>>>,
|
||||
@@ -725,10 +724,9 @@ pub struct EventLoopWindowTarget<T: 'static> {
|
||||
pub(super) destroys: Arc<Mutex<VecDeque<WindowId>>>,
|
||||
pub(super) event_socket: Arc<RedoxSocket>,
|
||||
pub(super) wake_socket: Arc<TimeSocket>,
|
||||
p: PhantomData<T>,
|
||||
}
|
||||
|
||||
impl<T: 'static> EventLoopWindowTarget<T> {
|
||||
impl EventLoopWindowTarget {
|
||||
pub fn primary_monitor(&self) -> Option<MonitorHandle> {
|
||||
Some(MonitorHandle)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user