Prevent terminator hiding due to right click. Refer to bug #843674

This commit is contained in:
Juliano Fischer Naves 2017-06-19 21:12:11 -04:00
parent 99a75bf395
commit a06f2808fb
2 changed files with 14 additions and 3 deletions

View File

@ -175,6 +175,7 @@ class Terminal(Gtk.VBox):
os.putenv('http_proxy', self.config['http_proxy']) os.putenv('http_proxy', self.config['http_proxy'])
self.reconfigure() self.reconfigure()
self.vte.set_size(80, 24) self.vte.set_size(80, 24)
self.preventHide = False
def get_vte(self): def get_vte(self):
"""This simply returns the vte widget we are using""" """This simply returns the vte widget we are using"""
@ -942,6 +943,7 @@ class Terminal(Gtk.VBox):
# plus either the app is not interested in mouse events or Shift is pressed # plus either the app is not interested in mouse events or Shift is pressed
if event.get_state() & Gdk.ModifierType.CONTROL_MASK == 0: if event.get_state() & Gdk.ModifierType.CONTROL_MASK == 0:
if event.get_state() & Gdk.ModifierType.SHIFT_MASK == 0: if event.get_state() & Gdk.ModifierType.SHIFT_MASK == 0:
self.preventHide = True
if not Vte.Terminal.do_button_press_event(self.vte, event): if not Vte.Terminal.do_button_press_event(self.vte, event):
right_click[0](*right_click[1]) right_click[0](*right_click[1])
else: else:

View File

@ -222,13 +222,22 @@ class Window(Container, Gtk.Window):
def on_focus_out(self, window, event): def on_focus_out(self, window, event):
"""Focus has left the window""" """Focus has left the window"""
preventHide = False
for terminal in self.get_visible_terminals(): for terminal in self.get_visible_terminals():
if terminal.preventHide:
preventHide = True
terminal.preventHide = False
terminal.on_window_focus_out() terminal.on_window_focus_out()
self.losefocus_time = time.time() self.losefocus_time = time.time()
if self.config['hide_on_lose_focus'] and self.get_property('visible'):
self.position = self.get_position() if not preventHide:
self.hidefunc() if self.config['hide_on_lose_focus'] and self.get_property('visible'):
self.position = self.get_position()
self.hidefunc()
else:
preventHide = False
def on_focus_in(self, window, event): def on_focus_in(self, window, event):
"""Focus has entered the window""" """Focus has entered the window"""