From 06f8d132963e23bef5d1a1ccb483787eadf31b3a Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 21 Dec 2014 17:53:20 -0500 Subject: Bug #1380413: make sure that the rect toolbar knows when and when not to update (bzr r13821) --- src/widgets/rect-toolbar.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/widgets/rect-toolbar.cpp') diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index b78f74d94..016aa4987 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -404,12 +404,20 @@ static void rect_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolB { static sigc::connection changed; - // TODO fixme: use of dynamic_cast<> seems wrong here. + // use of dynamic_cast<> seems wrong here -- we just need to check the current tool + if (dynamic_cast(ec)) { - changed = desktop->getSelection()->connectChanged(sigc::bind(sigc::ptr_fun(sp_rect_toolbox_selection_changed), holder)); + Inkscape::Selection *sel = desktop->getSelection(); + + changed = sel->connectChanged(sigc::bind(sigc::ptr_fun(sp_rect_toolbox_selection_changed), holder)); + + // Synthesize an emission to trigger the update + sp_rect_toolbox_selection_changed(sel, holder); } else { - if (changed) + if (changed) { changed.disconnect(); + purge_repr_listener(NULL, holder); + } } } -- cgit v1.2.3