summaryrefslogtreecommitdiffstats
path: root/src/arc-context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/arc-context.cpp')
-rw-r--r--src/arc-context.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index d47e22b1a..e689c93db 100644
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
@@ -50,6 +50,7 @@ static void sp_arc_context_init(SPArcContext *arc_context);
static void sp_arc_context_dispose(GObject *object);
static void sp_arc_context_setup(SPEventContext *ec);
+static void sp_arc_context_finish(SPEventContext *ec);
static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent *event);
static gint sp_arc_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event);
@@ -89,6 +90,7 @@ static void sp_arc_context_class_init(SPArcContextClass *klass)
object_class->dispose = sp_arc_context_dispose;
event_context_class->setup = sp_arc_context_setup;
+ event_context_class->finish = sp_arc_context_finish;
event_context_class->root_handler = sp_arc_context_root_handler;
event_context_class->item_handler = sp_arc_context_item_handler;
}
@@ -111,6 +113,20 @@ static void sp_arc_context_init(SPArcContext *arc_context)
new (&arc_context->sel_changed_connection) sigc::connection();
}
+static void sp_arc_context_finish(SPEventContext *ec)
+{
+ SPArcContext *ac = SP_ARC_CONTEXT(ec);
+ SPDesktop *desktop = ec->desktop;
+
+ sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+ sp_arc_finish(ac);
+ ac->sel_changed_connection.disconnect();
+
+ if (((SPEventContextClass *) parent_class)->finish) {
+ ((SPEventContextClass *) parent_class)->finish(ec);
+ }
+}
+
static void sp_arc_context_dispose(GObject *object)
{
SPEventContext *ec = SP_EVENT_CONTEXT(object);
@@ -223,7 +239,6 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
if (event->button.button == 1 && !event_context->space_panning) {
dragging = true;
- sp_event_context_snap_window_open(event_context);
ac->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
/* Snap center */
@@ -267,7 +282,7 @@ static gint sp_arc_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 arc
sp_arc_finish(ac);
@@ -324,7 +339,7 @@ static gint sp_arc_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_arc_cancel(ac);
ret = TRUE;
@@ -335,7 +350,7 @@ static gint sp_arc_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 arc
sp_arc_finish(ac);