diff --git a/gramps/gui/clipboard.py b/gramps/gui/clipboard.py index 7f50192a3..783231cbb 100644 --- a/gramps/gui/clipboard.py +++ b/gramps/gui/clipboard.py @@ -1477,6 +1477,7 @@ class MultiTreeView(Gtk.TreeView): Gtk.TreeView.__init__(self) self.connect('button_press_event', self.on_button_press) self.connect('button_release_event', self.on_button_release) + self.connect('grab_broken_event', self.on_grab_broken) self.connect('key_press_event', self.key_press_event) self.defer_select = False @@ -1578,6 +1579,11 @@ class MultiTreeView(Gtk.TreeView): self.defer_select=False + def on_grab_broken(self, widget, event): + # re-enable selection + self.get_selection().set_select_function(lambda *ignore: True, None) + self.defer_select=False + def edit_obj(self, objclass, handle): from .editors import (EditPerson, EditEvent, EditFamily, EditSource, EditPlace, EditRepository, EditNote, EditMedia, diff --git a/gramps/gui/widgets/multitreeview.py b/gramps/gui/widgets/multitreeview.py index e3e8221fa..72b2f9512 100644 --- a/gramps/gui/widgets/multitreeview.py +++ b/gramps/gui/widgets/multitreeview.py @@ -40,6 +40,7 @@ class MultiTreeView(Gtk.TreeView): Gtk.TreeView.__init__(self) self.connect('button_press_event', self.on_button_press) self.connect('button_release_event', self.on_button_release) + self.connect('grab_broken_event', self.on_grab_broken) self.connect('key_press_event', self.key_press_event) self.defer_select = False @@ -82,3 +83,7 @@ class MultiTreeView(Gtk.TreeView): self.defer_select=False + def on_grab_broken(self, widget, event): + # re-enable selection + self.get_selection().set_select_function(lambda *ignore: True, None) + self.defer_select=False