diff --git a/briar-gtk/briar_gtk/containers/main_window.py b/briar-gtk/briar_gtk/containers/main_window.py index 32a582fbb2c9119f30a26fc000177cd663a0b6b7..c6f8e6ce2f8598b0deea7c9a8e6e4fcc0b7990b8 100644 --- a/briar-gtk/briar_gtk/containers/main_window.py +++ b/briar-gtk/briar_gtk/containers/main_window.py @@ -191,14 +191,16 @@ class MainWindowContainer(Container): self.contacts_list_box.select_row(contact_row) # pylint: disable=unused-argument - def _refresh_contacts_async(self, message): - GLib.idle_add(self._refresh_contacts) + def _refresh_contacts_async(self, message, urgent=True): + GLib.idle_add(self._refresh_contacts, urgent) # pylint: disable=unused-argument def _refresh_contact_state(self, contact_id, connected): - self._refresh_contacts_async(None) + self._refresh_contacts_async(None, False) - def _refresh_contacts(self): + def _refresh_contacts(self, urgent): + if urgent: + APP().window.set_urgency_hint(True) self._save_selected_row() self._clear_contact_list() self._load_contacts() diff --git a/briar-gtk/briar_gtk/window.py b/briar-gtk/briar_gtk/window.py index 851664c80c476dd145d67ff3bd50ff7e4000298e..ab7132393e604ad88961d5a978d967a41059e475 100644 --- a/briar-gtk/briar_gtk/window.py +++ b/briar-gtk/briar_gtk/window.py @@ -19,6 +19,7 @@ class Window(Gtk.ApplicationWindow): self._initialize_gtk_application_window() WindowActions(self) self._setup_content() + self._setup_focus_listener() def show_main_container(self): self.current_container.destroy() @@ -37,6 +38,14 @@ class Window(Gtk.ApplicationWindow): self._resize_window(self.DEFAULT_WINDOW_SIZE) self._setup_startup_container() + def _setup_focus_listener(self): + self.connect("focus-in-event", self._on_focus_change) + self.connect("focus-out-event", self._on_focus_change) + + # pylint: disable=unused-argument + def _on_focus_change(self, widget, event): + self.set_urgency_hint(False) + def _resize_window(self, size): if not Window._size_is_valid(size): raise Exception("Couldn't resize window; invalid size parameter")