diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index 71f849c79..23c56298e 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -1767,7 +1767,7 @@ class Interface: self.roster.draw_contact(jid, account) if w: w.set_active_tab(ctrl) - w.window.get_window().focus(Gtk.get_current_event_time()) + w.window.present() # Using isinstance here because we want to catch all derived types if isinstance(ctrl, ChatControlBase): tv = ctrl.conv_textview @@ -2145,7 +2145,6 @@ class Interface: # For JEP-0172 if added_to_roster: ctrl.user_nick = app.nicks[account] - GLib.idle_add(mw.window.grab_focus) return ctrl diff --git a/gajim/remote_control.py b/gajim/remote_control.py index b1eff7350..de4d04979 100644 --- a/gajim/remote_control.py +++ b/gajim/remote_control.py @@ -519,7 +519,7 @@ class SignalObject(dbus.service.Object): win = app.interface.msg_win_mgr.get_window(jid, connected_account).window if win.get_property('visible'): - win.window.focus(Gtk.get_current_event_time()) + win.window.present() return DBUS_BOOLEAN(True) return DBUS_BOOLEAN(False) @@ -658,9 +658,9 @@ class SignalObject(dbus.service.Object): win.present() # preserve the 'steal focus preservation' if self._is_first(): - win.window.focus(Gtk.get_current_event_time()) + win.window.present() else: - win.window.focus(int(time())) + win.window.present_with_time(int(time())) @dbus.service.method(INTERFACE, in_signature='', out_signature='') def show_roster(self): @@ -671,9 +671,9 @@ class SignalObject(dbus.service.Object): win.present() # preserve the 'steal focus preservation' if self._is_first(): - win.window.focus(Gtk.get_current_event_time()) + win.window.present() else: - win.window.focus(int(time())) + win.window.present_with_time(int(time())) @dbus.service.method(INTERFACE, in_signature='', out_signature='') def toggle_ipython(self): diff --git a/gajim/roster_window.py b/gajim/roster_window.py index 7edaa55ab..dffc7d378 100644 --- a/gajim/roster_window.py +++ b/gajim/roster_window.py @@ -3131,7 +3131,6 @@ class RosterWindow: if gc_control: mw = app.interface.msg_win_mgr.get_window(jid, account) mw.set_active_tab(gc_control) - mw.window.get_window().focus(Gtk.get_current_event_time()) return ctrl = app.interface.minimized_controls[account][jid] mw = app.interface.msg_win_mgr.get_window(jid, account) @@ -3145,7 +3144,6 @@ class RosterWindow: ctrl.on_groupchat_maximize() mw.new_tab(ctrl) mw.set_active_tab(ctrl) - mw.window.get_window().focus(Gtk.get_current_event_time()) self.remove_groupchat(jid, account) def on_edit_account(self, widget, account): diff --git a/plugins/dbus_plugin/plugin.py b/plugins/dbus_plugin/plugin.py index 5c86cfb38..2d20301a2 100644 --- a/plugins/dbus_plugin/plugin.py +++ b/plugins/dbus_plugin/plugin.py @@ -367,7 +367,7 @@ if dbus_support.supported: win = gajim.interface.msg_win_mgr.get_window(jid, connected_account).window if win.get_property('visible'): - win.window.focus() + win.window.present() return DBUS_BOOLEAN(True) return DBUS_BOOLEAN(False) @@ -455,9 +455,9 @@ if dbus_support.supported: win.present() # preserve the 'steal focus preservation' if self._is_first(): - win.window.focus() + win.window.present() else: - win.window.focus(long(time())) + win.window.present_with_time(long(time())) @dbus.service.method(INTERFACE, in_signature='', out_signature='') def toggle_ipython(self):