diff --git a/src/chat_control.py b/src/chat_control.py index a5928e2e0..4b311ca3a 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -304,6 +304,7 @@ class ChatControlBase(MessageControl): self.user_nick = None self.smooth = True + self.msg_textview.grab_focus() def on_msg_textview_populate_popup(self, textview, menu): '''we override the default context menu and we prepend an option to switch languages''' @@ -1155,6 +1156,7 @@ class ChatControl(ChatControlBase): self.update_ui() # restore previous conversation self.restore_conversation() + self.msg_textview.grab_focus() def update_toolbar(self): # Add to roster diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 6c6ff651a..2ddae60ac 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -367,7 +367,7 @@ class GroupchatControl(ChatControlBase): gajim.gc_connected[self.account][self.room_jid] = False # disable win, we are not connected yet - ChatControlBase.got_disconnected(self) + ChatControlBase.got_disconnected(self) self.update_ui() self.conv_textview.tv.grab_focus() @@ -890,6 +890,8 @@ class GroupchatControl(ChatControlBase): if self.parent_win: self.parent_win.redraw_tab(self) + self.msg_textview.grab_focus() + def got_disconnected(self): self.list_treeview.get_model().clear() nick_list = gajim.contacts.get_nick_list(self.account, self.room_jid) diff --git a/src/message_window.py b/src/message_window.py index f27c23434..5c2ba4118 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -730,6 +730,10 @@ class MessageWindow(object): new_ctrl.set_control_active(True) self.show_title(control = new_ctrl) + control = self.get_active_control() + if isinstance(control, ChatControlBase): + control.msg_textview.grab_focus() + def _on_notebook_key_press(self, widget, event): # Ctrl+PageUP / DOWN has to be handled by notebook if (event.state & gtk.gdk.CONTROL_MASK and @@ -986,9 +990,6 @@ class MessageWindowMgr(gobject.GObject): if not self.one_window_opened(contact, acct, type): self._resize_window(win, acct, type) self._position_window(win, acct, type) - #FIXME: make sure when first chat tab is shown textview grabs focus - #this wont work but something close to that should be fine: - # win.window.grab_focus() self._windows[win_key] = win return win