Code

Add translator hint.
[inkscape.git] / src / event-context.cpp
index 99dc5ac20492cdbc225e2a9771faf8e49581e4f2..37711e9143fc89a656565280753dbb11a16fe97f 100644 (file)
@@ -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<NR::Rect> 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: