summaryrefslogtreecommitdiff
path: root/libs/canvas/canvas.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-01-10 11:02:05 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-01-10 11:02:05 -0500
commitffdf3ed01763197781a403d45c3b63f653045994 (patch)
tree50adabe58baf008d042ebd2c20cc153db111f294 /libs/canvas/canvas.cc
parentdaf51a2e49cee61f06eb632d5e2aaf7e18ebef56 (diff)
don't go through ::deliver_enter_leave() unnecessarily
Diffstat (limited to 'libs/canvas/canvas.cc')
-rw-r--r--libs/canvas/canvas.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc
index db38d2d9a1..5e5fd6e727 100644
--- a/libs/canvas/canvas.cc
+++ b/libs/canvas/canvas.cc
@@ -338,6 +338,7 @@ GtkCanvas::pick_current_item (Duple const & point, int state)
/* no items at point, just send leave event below */
} else {
+
if (within_items.front() == _current_item) {
/* uppermost item at point is already _current_item */
return;
@@ -346,7 +347,9 @@ GtkCanvas::pick_current_item (Duple const & point, int state)
_new_current_item = const_cast<Item*> (within_items.front());
}
- deliver_enter_leave (point, state);
+ if (_new_current_item != _current_item) {
+ deliver_enter_leave (point, state);
+ }
}
void
@@ -404,7 +407,7 @@ GtkCanvas::deliver_enter_leave (Duple const & point, int state)
} else if (_current_item->is_descendant_of (*_new_current_item)) {
/* move from descendant to ancestor (X: "_current_item is an
- * inferior of _new_current_item")
+ * inferior ("child") of _new_current_item")
*
* Deliver "virtual" leave notifications to all items in the
* heirarchy between current and new_current.
@@ -421,7 +424,7 @@ GtkCanvas::deliver_enter_leave (Duple const & point, int state)
} else if (_new_current_item->is_descendant_of (*_current_item)) {
/* move from ancestor to descendant (X: "_new_current_item is
- * an inferior of _current_item")
+ * an inferior ("child") of _current_item")
*
* Deliver "virtual" enter notifications to all items in the
* heirarchy between current and new_current.