Skip to content

Commit a6cb5a5

Browse files
committed
Don't call set_maximize each frame on Linux
Added by @konkitoman in #3172 I'm not sure what the hack is supposed to solve, but calling it every frame is a bad idea, as @ItsEthra reported in #3628 (comment) * Closes #3620 * Closes #3628
1 parent 43e7b16 commit a6cb5a5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/egui-winit/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,6 @@ impl State {
204204

205205
self.egui_input.time = Some(self.start_time.elapsed().as_secs_f64());
206206

207-
// TODO remove this in winit 0.29
208-
// This hack make the window outer_position and size to be valid, X11 Only
209-
// That was happending because winit get the window state before the compositor adds decorations!
210-
#[cfg(all(feature = "x11", target_os = "linux"))]
211-
window.set_maximized(window.is_maximized());
212-
213207
// On Windows, a minimized window will have 0 width and height.
214208
// See: https://github.com/rust-windowing/winit/issues/208
215209
// This solves an issue where egui window positions would be changed when minimizing on Windows.
@@ -1403,6 +1397,12 @@ pub fn apply_viewport_builder_to_new_window(window: &Window, builder: &ViewportB
14031397
log::warn!("set_cursor_hittest failed: {err}");
14041398
}
14051399
}
1400+
1401+
// TODO remove this in winit 0.29
1402+
// This hack make the window outer_position and size to be valid, X11 Only
1403+
// That was happending because winit get the window state before the compositor adds decorations!
1404+
#[cfg(all(feature = "x11", target_os = "linux"))]
1405+
window.set_maximized(builder.maximized.unwrap_or(false));
14061406
}
14071407

14081408
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)