mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
@@ -5,7 +5,7 @@
|
||||
//! There is a bunch of improvements we could do,
|
||||
//! like removing a bunch of `unwraps`.
|
||||
|
||||
use std::{cell::RefCell, rc::Rc, sync::Arc, time::Instant};
|
||||
use std::{cell::RefCell, num::NonZeroU32, rc::Rc, sync::Arc, time::Instant};
|
||||
|
||||
use parking_lot::Mutex;
|
||||
use raw_window_handle::{HasDisplayHandle as _, HasWindowHandle as _};
|
||||
@@ -437,13 +437,12 @@ impl WinitApp for WgpuWinitApp {
|
||||
self.init_run_state(egui_ctx, event_loop, storage, window, builder)?
|
||||
};
|
||||
|
||||
EventResult::RepaintNow(
|
||||
running.shared.borrow().viewports[&ViewportId::ROOT]
|
||||
.window
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.id(),
|
||||
)
|
||||
let viewport = &running.shared.borrow().viewports[&ViewportId::ROOT];
|
||||
if let Some(window) = &viewport.window {
|
||||
EventResult::RepaintNow(window.id())
|
||||
} else {
|
||||
EventResult::Wait
|
||||
}
|
||||
}
|
||||
|
||||
winit::event::Event::Suspended => {
|
||||
@@ -615,7 +614,9 @@ impl WgpuWinitRunning {
|
||||
}
|
||||
}
|
||||
|
||||
let egui_winit = egui_winit.as_mut().unwrap();
|
||||
let Some(egui_winit) = egui_winit.as_mut() else {
|
||||
return EventResult::Wait;
|
||||
};
|
||||
let mut raw_input = egui_winit.take_egui_input(window);
|
||||
|
||||
integration.pre_update();
|
||||
@@ -775,7 +776,6 @@ impl WgpuWinitRunning {
|
||||
// See: https://github.com/rust-windowing/winit/issues/208
|
||||
// This solves an issue where the app would panic when minimizing on Windows.
|
||||
if let Some(viewport_id) = viewport_id {
|
||||
use std::num::NonZeroU32;
|
||||
if let (Some(width), Some(height)) = (
|
||||
NonZeroU32::new(physical_size.width),
|
||||
NonZeroU32::new(physical_size.height),
|
||||
|
||||
Reference in New Issue
Block a user