diff --git a/src/rect-context.cpp b/src/rect-context.cpp
index 51b5f2e859c7f33b45bd487706d7a095c5baa122..b88b4b83aba5a5f1443f01cf2fce2646fff87752 100644 (file)
--- a/src/rect-context.cpp
+++ b/src/rect-context.cpp
static void sp_rect_context_dispose(GObject *object);
static void sp_rect_context_setup(SPEventContext *ec);
+static void sp_rect_context_finish(SPEventContext *ec);
static void sp_rect_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val);
static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent *event);
object_class->dispose = sp_rect_context_dispose;
event_context_class->setup = sp_rect_context_setup;
+ event_context_class->finish = sp_rect_context_finish;
event_context_class->set = sp_rect_context_set;
event_context_class->root_handler = sp_rect_context_root_handler;
event_context_class->item_handler = sp_rect_context_item_handler;
new (&rect_context->sel_changed_connection) sigc::connection();
}
+static void sp_rect_context_finish(SPEventContext *ec)
+{
+ SPRectContext *rc = SP_RECT_CONTEXT(ec);
+ SPDesktop *desktop = ec->desktop;
+
+ sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+ sp_rect_finish(rc);
+ rc->sel_changed_connection.disconnect();
+
+ if (((SPEventContextClass *) parent_class)->finish) {
+ ((SPEventContextClass *) parent_class)->finish(ec);
+ }
+}
+
+
static void sp_rect_context_dispose(GObject *object)
{
SPRectContext *rc = SP_RECT_CONTEXT(object);
@@ -258,7 +275,6 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
event_context->item_to_select = sp_event_context_find_item (desktop, button_w, event->button.state & GDK_MOD1_MASK, TRUE);
dragging = true;
- sp_event_context_snap_window_open(event_context);
/* Position center */
Geom::Point button_dt(desktop->w2d(button_w));
@@ -307,7 +323,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
event_context->xp = event_context->yp = 0;
if (event->button.button == 1 && !event_context->space_panning) {
dragging = false;
- sp_event_context_snap_window_closed(event_context, false); //button release will also occur on a double-click; in that case suppress warnings
+ sp_event_context_discard_delayed_snap_event(event_context);
if (!event_context->within_tolerance) {
// we've been dragging, finish the rect
@@ -375,7 +391,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
case GDK_Escape:
if (dragging) {
dragging = false;
- sp_event_context_snap_window_closed(event_context);
+ sp_event_context_discard_delayed_snap_event(event_context);
// if drawing, cancel, otherwise pass it up for deselecting
sp_rect_cancel(rc);
ret = TRUE;
@@ -387,7 +403,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
event->button.time);
dragging = false;
- sp_event_context_snap_window_closed(event_context);
+ sp_event_context_discard_delayed_snap_event(event_context);
if (!event_context->within_tolerance) {
// we've been dragging, finish the rect
sp_rect_finish(rc);