X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=shell%2Fev-view.c;h=b1ec0569c0deafc133db1e5c1672fd85589cffa8;hb=c1d81dab9d3476011fbc619b59f834b1e47bfb1e;hp=cbdffd80d235eb7369ba6a43bfeae682de299fac;hpb=982600bbceb76a22d5c7b3e0cbe6e20421105ad6;p=evince.git diff --git a/shell/ev-view.c b/shell/ev-view.c index cbdffd80..b1ec0569 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -489,7 +489,7 @@ view_update_range_and_current_page (EvView *view) } view->end_page = i; - } else if (found) { + } else if (found && view->current_page <= view->end_page) { break; } } @@ -1498,6 +1498,12 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y) if (view->cursor == EV_VIEW_CURSOR_HIDDEN) return; + + if (view->drag_info.in_drag) { + if (view->cursor != EV_VIEW_CURSOR_DRAG) + ev_view_set_cursor (view, EV_VIEW_CURSOR_DRAG); + return; + } link = ev_view_get_link_at_location (view, x, y); @@ -1531,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); @@ -1542,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); } } @@ -2653,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) @@ -2662,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); @@ -2981,21 +2989,20 @@ ev_view_button_release_event (GtkWidget *widget, GdkEventButton *event) { EvView *view = EV_VIEW (widget); - EvLink *link; + EvLink *link = NULL; + + view->drag_info.in_drag = FALSE; + view->image_dnd_info.in_drag = FALSE; if (view->pressed_button == 2) { - ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL); + ev_view_handle_cursor_over_xy (view, event->x, event->y); } if (view->document && view->pressed_button != 3) { link = ev_view_get_link_at_location (view, event->x, event->y); - } else { - link = NULL; } view->pressed_button = -1; - view->drag_info.in_drag = FALSE; - view->image_dnd_info.in_drag = FALSE; if (view->selection_scroll_id) { g_source_remove (view->selection_scroll_id); @@ -3357,9 +3364,8 @@ static gboolean ev_view_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event) { EvView *view = EV_VIEW (widget); - - if (view->cursor == EV_VIEW_CURSOR_LINK || - view->cursor == EV_VIEW_CURSOR_IBEAM) + + if (view->cursor != EV_VIEW_CURSOR_NORMAL) ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL); #if !GTK_CHECK_VERSION (2, 11, 7)