set the focus when the first tab is opened

This commit is contained in:
Denis Fomin 2012-08-24 18:21:38 +04:00
parent e56d5a5657
commit 004c0fbdf5
2 changed files with 1 additions and 3 deletions

View File

@ -12,7 +12,6 @@
<child> <child>
<object class="GtkNotebook" id="notebook"> <object class="GtkNotebook" id="notebook">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="scrollable">True</property> <property name="scrollable">True</property>
<property name="tab_border">0</property> <property name="tab_border">0</property>
</object> </object>

View File

@ -144,8 +144,6 @@ class MessageWindow(object):
self.notebook.set_show_border(gajim.config.get('tabs_border')) self.notebook.set_show_border(gajim.config.get('tabs_border'))
self.show_icon() self.show_icon()
gobject.idle_add(self.notebook.grab_focus)
def change_account_name(self, old_name, new_name): def change_account_name(self, old_name, new_name):
if old_name in self._controls: if old_name in self._controls:
self._controls[new_name] = self._controls[old_name] self._controls[new_name] = self._controls[old_name]
@ -307,6 +305,7 @@ class MessageWindow(object):
# NOTE: we do not call set_control_active(True) since we don't know # NOTE: we do not call set_control_active(True) since we don't know
# whether the tab is the active one. # whether the tab is the active one.
self.show_title() self.show_title()
gobject.timeout_add(500, control.msg_textview.grab_focus)
def on_tab_eventbox_button_press_event(self, widget, event, child): def on_tab_eventbox_button_press_event(self, widget, event, child):
if event.button == 3: # right click if event.button == 3: # right click