From 034bfb625073790210a9561477c2c8e9765843f0 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 26 Aug 2023 16:12:51 +0200 Subject: [PATCH] videoplayer: do not needlessly resize the window On window resize it pops us which may be annoying when playing same-sized files. --- videoplayer/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/videoplayer/src/main.rs b/videoplayer/src/main.rs index 37eb89d..3126b19 100644 --- a/videoplayer/src/main.rs +++ b/videoplayer/src/main.rs @@ -726,7 +726,9 @@ impl Player { "NihAV player".to_owned() }; window.set_title(&wname).expect("set window title"); - window.set_size(width as u32, height as u32).expect("resize window"); + if window.size() != (width as u32, height as u32) { + window.set_size(width as u32, height as u32).expect("resize window"); + } window.show(); let mut canvas = window.into_canvas().build().expect("should be able to build canvas"); let texture_creator = canvas.texture_creator(); -- 2.39.5