From 239f3d6afbb1c183b60ae1977d39987fdb8b02fe Mon Sep 17 00:00:00 2001 From: Julian Schmidhuber Date: Sun, 28 Apr 2024 15:40:30 +0200 Subject: [PATCH] fix(notification): Fix sometimes no notification sent This happened when the application was running in the background, and only for the last active channel. Fixes #203. --- CHANGELOG.md | 4 ++++ src/gui/window.rs | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 353d5ce..89057b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixes + +- No notifications being sent when Flare is in the background for the last active channel. + ## [0.14.3] - 2024-04-20 ### Fixes diff --git a/src/gui/window.rs b/src/gui/window.rs index 379fad3..0c79042 100644 --- a/src/gui/window.rs +++ b/src/gui/window.rs @@ -391,9 +391,11 @@ pub mod imp { fn setup_active_window_handler(&self) { let obj = self.obj(); - obj.connect_is_active_notify(clone!( - @weak self as w => move |window| { - w.channel_list.set_active(window.is_active()) + obj.connect_is_active_notify(clone!(@weak self as w => move |window| { + w.channel_list.set_active(window.is_active() && window.is_visible()) + })); + obj.connect_visible_notify(clone!(@weak self as w => move |window| { + w.channel_list.set_active(window.is_active() && window.is_visible()) })); }