119
120
# FIXME: Surely these should happen in Terminator::register_terminal()?
120
121
self.connect('enumerate', self.terminator.do_enumerate)
121
122
self.connect('focus-in', self.terminator.focus_changed)
123
self.connect('focus-out', self.terminator.focus_left)
123
125
self.matches = {}
124
126
self.cnxids = Signalman()
770
772
def on_group_button_press(self, widget, event):
771
773
"""Handler for the group button"""
772
774
if event.button == 1:
773
self.create_popup_group_menu(widget, event)
775
if event.type == gtk.gdk._2BUTTON_PRESS or \
776
event.type == gtk.gdk._3BUTTON_PRESS:
777
# Ignore these, or they make the interaction bad
779
# Super key applies interaction to all terms in group
780
include_siblings=event.state & gtk.gdk.MOD4_MASK == gtk.gdk.MOD4_MASK
782
targets=self.terminator.get_sibling_terms(self)
785
if event.state & gtk.gdk.CONTROL_MASK == gtk.gdk.CONTROL_MASK:
786
dbg('on_group_button_press: toggle terminal to focused terminals group')
787
focused=self.get_toplevel().get_focussed_terminal()
788
if focused in targets: targets.remove(focused)
790
if self.group==focused.group:
793
new_group=focused.group
794
[term.set_group(None, new_group) for term in targets]
795
[term.titlebar.update(focused) for term in targets]
797
elif event.state & gtk.gdk.SHIFT_MASK == gtk.gdk.SHIFT_MASK:
798
dbg('on_group_button_press: rename of terminals group')
799
self.targets_for_new_group = targets
800
self.titlebar.create_group()
802
elif event.type == gtk.gdk.BUTTON_PRESS:
803
# Single Click gives popup
804
dbg('on_group_button_press: group menu popup')
805
self.create_popup_group_menu(widget, event)
808
dbg('on_group_button_press: unknown group button interaction')
776
811
def on_keypress(self, widget, event):