From 6f57ad47ac30348c0ae2b7dba35d5ffdbf96f72d Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sun, 16 Jul 2023 20:38:16 +0100 Subject: [PATCH] fix(launcher): not setting focus state when opening favourite Fixes partially #225. --- src/modules/launcher/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/launcher/mod.rs b/src/modules/launcher/mod.rs index 5fded46..dc9d077 100644 --- a/src/modules/launcher/mod.rs +++ b/src/modules/launcher/mod.rs @@ -165,6 +165,7 @@ impl Module for LauncherModule { match item { None => { let item: Item = handle.try_into()?; + items.insert(info.app_id.clone(), item.clone()); ItemOrWindow::Item(item) @@ -358,9 +359,10 @@ impl Module for LauncherModule { buttons.insert(item.app_id, button); } } - LauncherUpdate::AddWindow(app_id, _) => { + LauncherUpdate::AddWindow(app_id, win) => { if let Some(button) = buttons.get(&app_id) { button.set_open(true); + button.set_focused(win.open_state.is_focused()); let mut menu_state = write_lock!(button.menu_state); menu_state.num_windows += 1;