summaryrefslogtreecommitdiffstats
path: root/src/select-context.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-04-13 23:02:53 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-04-13 23:02:53 +0000
commit829f3f0081a9b4a677a70607344cf0901cbee632 (patch)
tree4c4dd549b13fdd4bf585782d603d7bc956b50f73 /src/select-context.cpp
parentSome cleaning and reordering (diff)
downloadinkscape-829f3f0081a9b4a677a70607344cf0901cbee632.tar.gz
inkscape-829f3f0081a9b4a677a70607344cf0901cbee632.zip
fix select under by alt+click; prevent potential refcount leak
(bzr r2880)
Diffstat (limited to 'src/select-context.cpp')
-rw-r--r--src/select-context.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/select-context.cpp b/src/select-context.cpp
index 1e251244b..f6abf44f5 100644
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
@@ -322,6 +322,10 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
// remember the clicked item in sc->item:
+ if (sc->item) {
+ sp_object_unref(sc->item, NULL);
+ sc->item = NULL;
+ }
sc->item = sp_event_context_find_item (desktop,
NR::Point(event->button.x, event->button.y), event->button.state & GDK_MOD1_MASK, FALSE);
sp_object_ref(sc->item, NULL);
@@ -601,7 +605,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
} else { // it was just a click, or a too small rubberband
r->stop();
if (sc->button_press_shift && !rb_escaped && !drag_escaped) {
- // this was a shift-click, select what was clicked upon
+ // this was a shift+click or alt+shift+click, select what was clicked upon
sc->button_press_shift = false;
@@ -621,7 +625,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
item = NULL;
}
- } else if (sc->button_press_ctrl && !rb_escaped && !drag_escaped) { // ctrl-click
+ } else if ((sc->button_press_ctrl || sc->button_press_alt) && !rb_escaped && !drag_escaped) { // ctrl+click, alt+click
sc->button_press_ctrl = FALSE;