mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 07:03:14 -04:00
Add debug logging to help fix weird WSLg bug
This commit is contained in:
@@ -133,6 +133,13 @@ fn largest_monitor_point_size<E>(event_loop: &EventLoopWindowTarget<E>) -> egui:
|
||||
for monitor in event_loop.available_monitors() {
|
||||
let size = monitor.size().to_logical::<f32>(monitor.scale_factor());
|
||||
let size = egui::vec2(size.width, size.height);
|
||||
tracing::info!(
|
||||
"Monitor size: {}x{} pixels, {}x{} points",
|
||||
monitor.size().width,
|
||||
monitor.size().height,
|
||||
size.x,
|
||||
size.y
|
||||
);
|
||||
max_size = max_size.max(size);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,12 @@ impl WindowSettings {
|
||||
}
|
||||
|
||||
if let Some(inner_size_points) = self.inner_size_points {
|
||||
tracing::info!(
|
||||
"Restoring window size to {}x{} points, with fullscreen={}",
|
||||
inner_size_points.x,
|
||||
inner_size_points.y,
|
||||
self.fullscreen
|
||||
);
|
||||
window
|
||||
.with_inner_size(winit::dpi::LogicalSize {
|
||||
width: inner_size_points.x as f64,
|
||||
@@ -80,6 +86,8 @@ impl WindowSettings {
|
||||
use egui::NumExt as _;
|
||||
|
||||
if let Some(size) = &mut self.inner_size_points {
|
||||
tracing::info!("Clamping size to {}x{} points", max_size.x, max_size.y);
|
||||
|
||||
// Prevent ridiculously small windows
|
||||
let min_size = egui::Vec2::splat(64.0);
|
||||
*size = size.at_least(min_size);
|
||||
|
||||
Reference in New Issue
Block a user