From: Kostya Shishkov Date: Sat, 26 Aug 2023 14:12:51 +0000 (+0200) Subject: videoplayer: do not needlessly resize the window X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=034bfb625073790210a9561477c2c8e9765843f0;p=nihav-player.git videoplayer: do not needlessly resize the window On window resize it pops us which may be annoying when playing same-sized files. --- 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();