evince r2839 - in trunk: . shell



Author: carlosgc
Date: Tue Jan 22 18:26:19 2008
New Revision: 2839
URL: http://svn.gnome.org/viewvc/evince?rev=2839&view=rev

Log:
2008-01-22  Carlos Garcia Campos  <carlosgc gnome org>
	* shell/ev-view.c: (ev_view_handle_cursor_over_xy),
	(ev_view_button_press_event), (ev_view_motion_notify_event),
	(ev_view_button_release_event):
	Restore cursor after autoscrolling. Fixes bug #509958.


Modified:
   trunk/ChangeLog
   trunk/shell/ev-view.c

Modified: trunk/shell/ev-view.c
==============================================================================
--- trunk/shell/ev-view.c	(original)
+++ trunk/shell/ev-view.c	Tue Jan 22 18:26:19 2008
@@ -1575,7 +1575,8 @@
 	} else {
 		if (view->cursor == EV_VIEW_CURSOR_LINK ||
 		    view->cursor == EV_VIEW_CURSOR_IBEAM ||
-		    view->cursor == EV_VIEW_CURSOR_DRAG)
+		    view->cursor == EV_VIEW_CURSOR_DRAG ||
+		    view->cursor == EV_VIEW_CURSOR_AUTOSCROLL)
 			ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
 	}
 }
@@ -2687,15 +2688,12 @@
 	
 	view->pressed_button = event->button;
 	view->selection_info.in_drag = FALSE;
+
+	if (view->scroll_info.autoscrolling)
+		return TRUE;
 	
 	switch (event->button) {
 	        case 1: {
-
-			if (view->scroll_info.autoscrolling == TRUE) {
-				view->scroll_info.autoscrolling = FALSE;
-				return TRUE;
-			}
-
 			EvImage *image;
 			EvFormField *field;
 
@@ -2734,10 +2732,6 @@
 		case 2:
 			/* use root coordinates as reference point because
 			 * scrolling changes window relative coordinates */
-			if (view->scroll_info.autoscrolling == TRUE) {
-				view->scroll_info.autoscrolling = FALSE;
-				return TRUE;
-			}
 			view->drag_info.start.x = event->x_root;
 			view->drag_info.start.y = event->y_root;
 			view->drag_info.hadj = gtk_adjustment_get_value (view->hadjustment);
@@ -2747,8 +2741,7 @@
 
 			return TRUE;
 		case 3:
-			if (!view->scroll_info.autoscrolling)
-				view->scroll_info.start_y = event->y;
+			view->scroll_info.start_y = event->y;
 			return ev_view_do_popup_menu (view, event->x, event->y);
 	}
 	
@@ -3005,6 +2998,7 @@
 
 	if (view->scroll_info.autoscrolling) {
 		view->scroll_info.last_y = y;
+		return TRUE;
 	}
 
 	if (view->selection_info.in_drag) {
@@ -3140,6 +3134,18 @@
 
 	view->drag_info.in_drag = FALSE;
 	view->image_dnd_info.in_drag = FALSE;
+
+	if (view->scroll_info.autoscrolling) {
+		view->scroll_info.autoscrolling = FALSE;
+		if (view->scroll_info.timeout_id) {
+			g_source_remove (view->scroll_info.timeout_id);
+			view->scroll_info.timeout_id = 0;
+		}
+		ev_view_handle_cursor_over_xy (view, event->x, event->y);
+		view->pressed_button = -1;
+
+		return TRUE;
+	} 
 	
 	view->drag_info.release_timeout_id = g_timeout_add (20,
 			(GSourceFunc)ev_view_scroll_drag_release, view);
@@ -4422,7 +4428,8 @@
 	gtk_widget_queue_draw (GTK_WIDGET (view));
 }
 
-static gboolean ev_view_autoscroll_cb (EvView *view)
+static gboolean
+ev_view_autoscroll_cb (EvView *view)
 {
 	gdouble speed, value;
 
@@ -4455,7 +4462,8 @@
 
 }
 
-void ev_view_autoscroll(EvView *view)
+void
+ev_view_autoscroll (EvView *view)
 {
 	view->scroll_info.autoscrolling = TRUE;
 	view->scroll_info.timeout_id = g_timeout_add (20, (GSourceFunc)(ev_view_autoscroll_cb), view);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]