From 3c22ab752ac64871f14b4b88297ee075394c2801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 12 May 2018 23:36:52 +0200 Subject: [PATCH] Bring control to front when notification is clicked if autopopup_chat_opened is activated no control is found because the event that triggered the notification is already deleted when the notification is clicked by the user. So instead of searching for the event, search for the control with jid/account. Fixes #9124 --- gajim/gui_interface.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index 539e22503..6b72e8217 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -1664,7 +1664,15 @@ class Interface: if not event: event = app.events.get_first_event(account, jid, type_) if not event: - return + # If autopopup_chat_opened = True, then we send out + # notifications even if a control is open. This means the + # event is already deleted (because its printed to the + # control) when the notification is clicked. So try to + # get a control from account/jid + ctrl = self.msg_win_mgr.get_control(fjid, account) + if ctrl is None: + return + w = ctrl.parent_win if type_ == 'printed_chat': ctrl = event.control