From: Krzysztof KosiƄski Date: Wed, 20 Jan 2010 16:37:55 +0000 (+0100) Subject: Fix middle click zoom in the node tool. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=35295a19d4d6164caf2af84d18701ab292e24fb5;p=inkscape.git Fix middle click zoom in the node tool. --- diff --git a/src/ui/tool/selector.cpp b/src/ui/tool/selector.cpp index f95c9e064..bf3ea6714 100644 --- a/src/ui/tool/selector.cpp +++ b/src/ui/tool/selector.cpp @@ -21,7 +21,9 @@ namespace Inkscape { namespace UI { /** A hidden control point used for rubberbanding and selection. - * It uses a clever hack: the canvas item is hidden and only receives events when fed */ + * It uses a clever hack: the canvas item is hidden and only receives events when they + * are passed to it using Selector's event() function. When left mouse button + * is pressed, it grabs events and handles drags and clicks in the usual way. */ class SelectorPoint : public ControlPoint { public: SelectorPoint(SPDesktop *d, SPCanvasGroup *group, Selector *s) @@ -109,8 +111,14 @@ Selector::~Selector() bool Selector::event(GdkEvent *event) { + // The hidden control point will capture all events after it obtains the grab, + // but it relies on this function to initiate it. Here we can filter what events + // it will receive. switch (event->type) { case GDK_BUTTON_PRESS: + // Do not pass button presses other than left button to the control point. + // This way middle click and right click can be handled in SPEventContext. + if (event->button.button != 1) return false; _dragger->setPosition(_desktop->w2d(event_point(event->motion))); break; default: break;