From c16411544ed9772eda9b5cd694efb85c51005057 Mon Sep 17 00:00:00 2001 From: mtkennerly Date: Tue, 15 Oct 2024 21:58:22 -0400 Subject: [PATCH] Focus window on start --- CHANGELOG.md | 4 ++-- src/gui/app.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74eb2ac..a85dd70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,8 +24,8 @@ to better preserve the files' executable permissions. Now, with `--force`, Ludusavi will not wait for any input. * Old log files were not deleted when stored on a Windows network share. * Changed: - * GUI: Updated to the latest version of [Iced](https://github.com/iced-rs/iced). - If the GUI fails to load, Ludusavi will log the error info. + * GUI: If the GUI fails to load, Ludusavi will try to log the error info. + * GUI: When you launch Ludusavi, the window now ensures that it gains focus. * GUI: Modals now display on top of the app with a transparent background. * GUI: On the backup and restore screens, the filter controls now wrap depending on the window size. diff --git a/src/gui/app.rs b/src/gui/app.rs index fc085dd..d78f8ca 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -1270,6 +1270,7 @@ impl App { let mut commands = vec![ iced::font::load(std::borrow::Cow::Borrowed(crate::gui::font::TEXT_DATA)).map(|_| Message::Ignore), iced::font::load(std::borrow::Cow::Borrowed(crate::gui::font::ICONS_DATA)).map(|_| Message::Ignore), + iced::window::get_oldest().and_then(iced::window::gain_focus), ]; if flags.update_manifest { commands.push(Self::update_manifest(