summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5cd23a6)
raw | patch | inline | side by side (parent: 5cd23a6)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Wed, 3 Mar 2010 00:35:08 +0000 (01:35 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Wed, 3 Mar 2010 00:35:08 +0000 (01:35 +0100) |
src/ui/tool/control-point.cpp | patch | blob | history |
index b9a793ca4051952dd2bdba04c34af4ba4fb024a6..b74e3bc9c1f9b98089285f329170ca5ee5b0b2b6 100644 (file)
int drag_tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
switch(event->type)
- {
- case GDK_2BUTTON_PRESS:
- // store the button number for next release
- next_release_doubleclick = event->button.button;
- return true;
-
+ {
case GDK_BUTTON_PRESS:
next_release_doubleclick = 0;
if (event->button.button == 1) {
return true;
}
return false;
+
+ case GDK_2BUTTON_PRESS:
+ // store the button number for next release
+ next_release_doubleclick = event->button.button;
+ return true;
case GDK_MOTION_NOTIFY:
combine_motion_events(_desktop->canvas, event->motion, 0);
if (t) return true;
// if we are here, it means the tolerance was just exceeded.
- next_release_doubleclick = 0;
_drag_origin = _position;
transferred = grabbed(&event->motion);
// _drag_initiated might change during the above virtual call
sp_canvas_end_forced_full_redraws(_desktop->canvas);
}
- if (next_release_doubleclick) {
+ if (_drag_initiated) {
+ // it is the end of a drag
_drag_initiated = false;
- return doubleclicked(&event->button);
- }
- if (event->button.button == 1) {
- if (_drag_initiated) {
- // it is the end of a drag
- ungrabbed(&event->button);
- _drag_initiated = false;
- return true;
+ ungrabbed(&event->button);
+ return true;
+ } else {
+ // it is the end of a click
+ if (next_release_doubleclick) {
+ return doubleclicked(&event->button);
} else {
- // it is the end of a click
return clicked(&event->button);
}
}
- _drag_initiated = false;
}
break;