Add debug logging to help fix weird WSLg bug
This commit is contained in:
parent
df9df39f10
commit
739d918e92
2 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue