diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-01-20 16:37:55 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-01-20 16:37:55 +0000 |
| commit | d85c1f7df8f884e92a362e6f1dec34c2479cbfd4 (patch) | |
| tree | bed4279fe11fbed490c1014648f867d66c16111a /src/ui/tool/selector.cpp | |
| parent | Fix path reverse action (Shift+R) in the node tool. (diff) | |
| download | inkscape-d85c1f7df8f884e92a362e6f1dec34c2479cbfd4.tar.gz inkscape-d85c1f7df8f884e92a362e6f1dec34c2479cbfd4.zip | |
Fix middle click zoom in the node tool.
(bzr r9004)
Diffstat (limited to 'src/ui/tool/selector.cpp')
| -rw-r--r-- | src/ui/tool/selector.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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; |
