diff --git a/gajim/dialogs.py b/gajim/dialogs.py index 804ae8840..9a045ad5b 100644 --- a/gajim/dialogs.py +++ b/gajim/dialogs.py @@ -2364,7 +2364,8 @@ class SubscriptionRequestWindow(Gtk.ApplicationWindow): self.destroy() class JoinGroupchatWindow(Gtk.ApplicationWindow): - def __init__(self, account, room_jid, password=None, automatic=None): + def __init__(self, account, room_jid, password=None, automatic=None, + transient_for=None): Gtk.ApplicationWindow.__init__(self) self.set_name('JoinGroupchat') self.set_application(app.app) @@ -2372,6 +2373,8 @@ class JoinGroupchatWindow(Gtk.ApplicationWindow): self.set_resizable(False) self.set_position(Gtk.WindowPosition.CENTER) self.set_title(_('Join Groupchat')) + if transient_for: + self.set_transient_for(transient_for) self.automatic = automatic self.password = password diff --git a/gajim/disco.py b/gajim/disco.py index 0a807ed89..48f1ff827 100644 --- a/gajim/disco.py +++ b/gajim/disco.py @@ -1399,7 +1399,8 @@ class ToplevelAgentBrowser(AgentBrowser): if not iter_: return service = model[iter_][0] - app.interface.join_gc_minimal(self.account, service) + app.interface.join_gc_minimal(self.account, service, + transient_for=self.window.window) def update_actions(self): if self.execute_button: diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index d99eb7ff3..ed7fc2990 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -1818,7 +1818,8 @@ class Interface: ctrl.scroll_to_end() - def join_gc_minimal(self, account, room_jid, password=None): + def join_gc_minimal(self, account, room_jid, password=None, + transient_for=None): if account is not None: if app.in_groupchat(account, room_jid): # If we already in the groupchat, join_gc_room will bring @@ -1855,7 +1856,8 @@ class Interface: dialogs.ErrorDialog(_('JID is not a Groupchat'), transient_for=app.app.get_active_window()) return - dialogs.JoinGroupchatWindow(account, room_jid, password=password) + dialogs.JoinGroupchatWindow(account, room_jid, password=password, + transient_for=transient_for) disco_account = connected_accounts[0] if account is None else account app.connections[disco_account].discoverMUC(