]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-view.c
Restore cursor to normal after a drag operation. Fixes bug #501603.
[evince.git] / shell / ev-view.c
index 761594a53f3c16452b1aec4cbc9e91ea231fddb2..b1ec0569c0deafc133db1e5c1672fd85589cffa8 100644 (file)
@@ -1537,7 +1537,8 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y)
        } else if ((field = ev_view_get_form_field_at_location (view, x, y))) {
                if (field->is_read_only) {
                        if (view->cursor == EV_VIEW_CURSOR_LINK ||
-                           view->cursor == EV_VIEW_CURSOR_IBEAM)
+                           view->cursor == EV_VIEW_CURSOR_IBEAM ||
+                           view->cursor == EV_VIEW_CURSOR_DRAG)
                                ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
                } else if (EV_IS_FORM_FIELD_TEXT (field)) {
                        ev_view_set_cursor (view, EV_VIEW_CURSOR_IBEAM);
@@ -1548,7 +1549,8 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y)
                ev_view_set_cursor (view, EV_VIEW_CURSOR_IBEAM);
        } else {
                if (view->cursor == EV_VIEW_CURSOR_LINK ||
-                   view->cursor == EV_VIEW_CURSOR_IBEAM)
+                   view->cursor == EV_VIEW_CURSOR_IBEAM ||
+                   view->cursor == EV_VIEW_CURSOR_DRAG)
                        ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
        }
 }
@@ -2659,6 +2661,9 @@ ev_view_button_press_event (GtkWidget      *widget,
                                }
 
                                gtk_widget_queue_draw (widget);
+                       } else if ((field = ev_view_get_form_field_at_location (view, event->x, event->y))) {
+                               ev_view_remove_all (view);
+                               ev_view_handle_form_field (view, field, event->x, event->y);
                        } else if (!location_in_text (view, event->x + view->scroll_x, event->y + view->scroll_y) &&
                                   (image = ev_view_get_image_at_location (view, event->x, event->y))) {
                                if (view->image_dnd_info.image)
@@ -2668,9 +2673,6 @@ ev_view_button_press_event (GtkWidget      *widget,
 
                                view->image_dnd_info.start.x = event->x + view->scroll_x;
                                view->image_dnd_info.start.y = event->y + view->scroll_y;
-                       } else if ((field = ev_view_get_form_field_at_location (view, event->x, event->y))) {
-                               ev_view_remove_all (view);
-                               ev_view_handle_form_field (view, field, event->x, event->y);
                        } else {
                                ev_view_remove_all (view);