Skip to content

Commit

Permalink
Hack to fix "Not focused on openning if tab was moved" (Guake#441)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
  • Loading branch information
gsemet committed Apr 22, 2015
1 parent 197bbd1 commit b770324
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/guake/guake_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,7 @@ def on_drop_tab(self, widget, context, x, y, selection, targetType, data):
def move_tab(self, old_tab_pos, new_tab_pos):
self.notebook.reorder_child(self.notebook.get_nth_page(old_tab_pos), new_tab_pos)
self.tabs.reorder_child(self.tabs.get_children()[old_tab_pos], new_tab_pos)
self.notebook.set_current_page(new_tab_pos)

def delete_tab(self, pagepos, kill=True):
"""This function will destroy the notebook page, terminal and
Expand All @@ -1385,6 +1386,11 @@ def set_terminal_focus(self):
"""Grabs the focus on the current tab.
"""
self.notebook.get_current_terminal().grab_focus()
self.notebook.set_current_page(self.get_selected_tab())
# Hack to fix "Not focused on openning if tab was moved" (#441)
pos = self.get_selected_tab()
self.select_tab(0)
self.select_tab(pos)

def select_current_tab(self, notebook, user_data, page):
"""When current self.notebook page is changed, the tab bar
Expand Down

0 comments on commit b770324

Please sign in to comment.