diff --git a/src/config.py b/src/config.py
index 212d7d9ee84db9eb548659d7b4d3dda50a4af14d..f6e5ab0c49414ee92237543c68a98b7f5c67b90b 100644
--- a/src/config.py
+++ b/src/config.py
@@ -2139,7 +2139,8 @@ class AccountsWindow:
         message = _('Enter a new name for account %s') % self.current_account
         old_text = self.current_account
         dialogs.InputDialog(title, message, old_text, is_modal=False,
-                ok_handler=(on_renamed, self.current_account))
+            ok_handler=(on_renamed, self.current_account),
+            transient_for=self.window)
 
     def option_changed(self, option, value):
         return gajim.config.get_per('accounts', self.current_account, option) \
diff --git a/src/gui_interface.py b/src/gui_interface.py
index 81e4e400787202d7b2255cb19844c473b45fa68b..21db4c836a48ef47b1d30050c5fad892e450ddd8 100644
--- a/src/gui_interface.py
+++ b/src/gui_interface.py
@@ -1175,7 +1175,7 @@ class Interface:
         dlg = dialogs.InputDialog(_('Username Conflict'),
             _('Please type a new username for your local account'),
             input_str=obj.alt_name, is_modal=True, ok_handler=on_ok,
-            cancel_handler=on_cancel)
+            cancel_handler=on_cancel, transient_for=self.roster.window)
 
     def handle_event_resource_conflict(self, obj):
         # ('RESOURCE_CONFLICT', account, ())