From: Kostya Shishkov Date: Tue, 1 Aug 2023 16:41:32 +0000 (+0200) Subject: videoplayer: work around SDL window title bug X-Git-Url: https://git.nihav.org/?p=nihav-player.git;a=commitdiff_plain;h=75da2ee6907400431ddd81c95cdd9aea507cf6f7 videoplayer: work around SDL window title bug --- diff --git a/videoplayer/src/main.rs b/videoplayer/src/main.rs index 98d3447..89deb7c 100644 --- a/videoplayer/src/main.rs +++ b/videoplayer/src/main.rs @@ -722,7 +722,10 @@ impl Player { let fname = path.file_name(); let wname = if let Some(fname) = fname { - "NihAV player - ".to_owned() + fname.to_str().expect("should be able to set window title") + // workaround for libSDL2 workaround for non-UTF8 windowing systems + // see https://github.com/libsdl-org/SDL/pull/4290 for detais + let nname = fname.to_str().expect("should be able to set window title").replace('\u{2013}', "-"); + "NihAV player - ".to_owned() + &nname } else { "NihAV player".to_owned() };