mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Improve clippy, and add more docs (#3306)
* Silence a few clippy warnings * Use named threads * Remove some deprecated functions * Document Context and Ui fully * Use `parking_lot::Mutex` in `eframe` * Expand clippy.toml files * build fix
This commit is contained in:
@@ -1092,6 +1092,8 @@ pub use glow_integration::run_glow;
|
||||
mod wgpu_integration {
|
||||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use super::*;
|
||||
|
||||
/// State that is initialized when the application is first starts running via
|
||||
@@ -1104,7 +1106,7 @@ mod wgpu_integration {
|
||||
}
|
||||
|
||||
struct WgpuWinitApp {
|
||||
repaint_proxy: Arc<std::sync::Mutex<EventLoopProxy<UserEvent>>>,
|
||||
repaint_proxy: Arc<Mutex<EventLoopProxy<UserEvent>>>,
|
||||
app_name: String,
|
||||
native_options: epi::NativeOptions,
|
||||
app_creator: Option<epi::AppCreator>,
|
||||
@@ -1130,7 +1132,7 @@ mod wgpu_integration {
|
||||
);
|
||||
|
||||
Self {
|
||||
repaint_proxy: Arc::new(std::sync::Mutex::new(event_loop.create_proxy())),
|
||||
repaint_proxy: Arc::new(Mutex::new(event_loop.create_proxy())),
|
||||
app_name: app_name.to_owned(),
|
||||
native_options,
|
||||
running: None,
|
||||
@@ -1215,7 +1217,7 @@ mod wgpu_integration {
|
||||
);
|
||||
#[cfg(feature = "accesskit")]
|
||||
{
|
||||
integration.init_accesskit(&window, self.repaint_proxy.lock().unwrap().clone());
|
||||
integration.init_accesskit(&window, self.repaint_proxy.lock().clone());
|
||||
}
|
||||
let theme = system_theme.unwrap_or(self.native_options.default_theme);
|
||||
integration.egui_ctx.set_visuals(theme.egui_visuals());
|
||||
@@ -1232,7 +1234,6 @@ mod wgpu_integration {
|
||||
let frame_nr = info.current_frame_nr;
|
||||
event_loop_proxy
|
||||
.lock()
|
||||
.unwrap()
|
||||
.send_event(UserEvent::RequestRepaint { when, frame_nr })
|
||||
.ok();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user