X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fevent-context.cpp;h=37711e9143fc89a656565280753dbb11a16fe97f;hb=1c2557cd7259a8166f07b7982a44e040a44d4db1;hp=99dc5ac20492cdbc225e2a9771faf8e49581e4f2;hpb=04f50952e01e32eef6902cce4cc1df66e9a6f2c2;p=inkscape.git diff --git a/src/event-context.cpp b/src/event-context.cpp index 99dc5ac20..37711e914 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -190,6 +190,7 @@ sp_event_context_update_cursor(SPEventContext *ec) } gdk_window_set_cursor(w->window, ec->cursor); } + ec->desktop->waiting_cursor = false; } /** @@ -417,32 +418,35 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, && ( abs( (gint) event->motion.y - yp ) < tolerance ) ) { break; // do not drag if we're within tolerance from origin } - - if (within_tolerance) { - Inkscape::Rubberband::get()->start(desktop, motion_dt); - } else { - Inkscape::Rubberband::get()->move(motion_dt); - } - // Once the user has moved farther than tolerance from the original location // (indicating they intend to move the object, not click), then always process the // motion notify coordinates as given (no snapping back to origin) within_tolerance = false; + + if (Inkscape::Rubberband::get()->is_started()) { + Inkscape::Rubberband::get()->move(motion_dt); + } else { + Inkscape::Rubberband::get()->start(desktop, motion_dt); + } } break; case GDK_BUTTON_RELEASE: xp = yp = 0; if (within_tolerance && (panning || zoom_rb)) { zoom_rb = 0; + if (panning) { + panning = 0; + sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), + event->button.time); + } NR::Point const event_w(event->button.x, event->button.y); NR::Point const event_dt(desktop->w2d(event_w)); desktop->zoom_relative_keep_point(event_dt, (event->button.state & GDK_SHIFT_MASK) ? 1/zoom_inc : zoom_inc); desktop->updateNow(); - } - if (panning == event->button.button) { - panning = 0; ret = TRUE; + } else if (panning == event->button.button) { + panning = 0; sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); @@ -453,15 +457,16 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, NR::Point const motion_w(event->button.x, event->button.y); NR::Point const moved_w( motion_w - button_w ); event_context->desktop->scroll_world(moved_w); - desktop->updateNow(); + ret = TRUE; } else if (zoom_rb == event->button.button) { zoom_rb = 0; NR::Maybe const b = Inkscape::Rubberband::get()->getRectangle(); Inkscape::Rubberband::get()->stop(); - if (b != NR::Nothing() && !within_tolerance) { - desktop->set_display_area(b.assume(), 10); + if (b && !within_tolerance) { + desktop->set_display_area(*b, 10); } + ret = TRUE; } break; case GDK_KEY_PRESS: