diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-08-01 12:29:37 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-08-01 12:29:37 +0000 |
| commit | 1619e274a9d9193fbd6df1b7817beaa96d030e6a (patch) | |
| tree | e48bd51911372c4b47b99e0f0060b60790b13a7d /src/arc-context.cpp | |
| parent | update (diff) | |
| download | inkscape-1619e274a9d9193fbd6df1b7817beaa96d030e6a.tar.gz inkscape-1619e274a9d9193fbd6df1b7817beaa96d030e6a.zip | |
When switching context by pressing a key, while dragging to create a new shape, the original context should be finished properly and sp_canvas_item_ungrab should be called. set_event_context() was looking for e.g. sp_rect_context_finish, but this wasn't implemented for any of the shape tools. This closes bug #195101
(bzr r8375)
Diffstat (limited to 'src/arc-context.cpp')
| -rw-r--r-- | src/arc-context.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arc-context.cpp b/src/arc-context.cpp index dcb326bcd..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); |
