From b8ed9d236dc560adc83245ce50e0630a0c482496 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 30 Oct 2018 23:22:11 +0100 Subject: KnotHolder: fix knots selection status when a knot is clicked without Shift When there are already selected knots, and _another_ knot is clicked without the Shift key pressed, the user would expects the previously selected knots to be unselected immediately, but this does not happen until the mouse button is released. Steps to replicate: 1. Change size of a rect using one corner. 2. Change the size using the opposite corner (without pressing Shift). Observed behavior: The first corner looks still selected during grab. Expected behavior: The first corner gets unelected as soon as the mouse button is pressed.. This happens because the knots selection status is not updated until the mouse button is released, i.e. in the click/ungrabbed signal handler. In order to have a more immediate feedback of the knot selection status, add a "mousedown" signal handler and update the selection status in there. While at it also remove the knot_holder local variable in knot_clicked_handler() which seems to be unnecessary. --- src/knot-holder-entity.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/knot-holder-entity.cpp') diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 3664bbc81..9408e7942 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -58,6 +58,7 @@ void KnotHolderEntity::create(SPDesktop *desktop, SPItem *item, KnotHolder *pare update_knot(); knot->show(); + _mousedown_connection = knot->mousedown_signal.connect(sigc::mem_fun(*parent_holder, &KnotHolder::knot_mousedown_handler)); _moved_connection = knot->moved_signal.connect(sigc::mem_fun(*parent_holder, &KnotHolder::knot_moved_handler)); _click_connection = knot->click_signal.connect(sigc::mem_fun(*parent_holder, &KnotHolder::knot_clicked_handler)); _ungrabbed_connection = knot->ungrabbed_signal.connect(sigc::mem_fun(*parent_holder, &KnotHolder::knot_ungrabbed_handler)); @@ -66,6 +67,7 @@ void KnotHolderEntity::create(SPDesktop *desktop, SPItem *item, KnotHolder *pare KnotHolderEntity::~KnotHolderEntity() { + _mousedown_connection.disconnect(); _moved_connection.disconnect(); _click_connection.disconnect(); _ungrabbed_connection.disconnect(); -- cgit v1.2.3