summaryrefslogtreecommitdiffstats
path: root/src/star-context.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-08-01 12:29:37 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-08-01 12:29:37 +0000
commit1619e274a9d9193fbd6df1b7817beaa96d030e6a (patch)
treee48bd51911372c4b47b99e0f0060b60790b13a7d /src/star-context.cpp
parentupdate (diff)
downloadinkscape-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/star-context.cpp')
-rw-r--r--src/star-context.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/star-context.cpp b/src/star-context.cpp
index 80d378f27..3d6825e31 100644
--- a/src/star-context.cpp
+++ b/src/star-context.cpp
@@ -52,6 +52,7 @@ static void sp_star_context_init (SPStarContext * star_context);
static void sp_star_context_dispose (GObject *object);
static void sp_star_context_setup (SPEventContext *ec);
+static void sp_star_context_finish(SPEventContext *ec);
static void sp_star_context_set (SPEventContext *ec, Inkscape::Preferences::Entry *val);
static gint sp_star_context_root_handler (SPEventContext *ec, GdkEvent *event);
@@ -92,6 +93,7 @@ sp_star_context_class_init (SPStarContextClass * klass)
object_class->dispose = sp_star_context_dispose;
event_context_class->setup = sp_star_context_setup;
+ event_context_class->finish = sp_star_context_finish;
event_context_class->set = sp_star_context_set;
event_context_class->root_handler = sp_star_context_root_handler;
}
@@ -119,6 +121,21 @@ sp_star_context_init (SPStarContext * star_context)
new (&star_context->sel_changed_connection) sigc::connection();
}
+static void sp_star_context_finish(SPEventContext *ec)
+{
+ SPStarContext *sc = SP_STAR_CONTEXT(ec);
+ SPDesktop *desktop = ec->desktop;
+
+ sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+ sp_star_finish(sc);
+ sc->sel_changed_connection.disconnect();
+
+ if (((SPEventContextClass *) parent_class)->finish) {
+ ((SPEventContextClass *) parent_class)->finish(ec);
+ }
+}
+
+
static void
sp_star_context_dispose (GObject *object)
{