[evince] Use ev_document_misc_get_pointer_position() instad of gtk_widget_get_pointer()



commit 2a4f84ed8a7f380e5f55a04885819f8c21e9d4a1
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sun Dec 4 12:46:25 2011 +0100

    Use ev_document_misc_get_pointer_position() instad of gtk_widget_get_pointer()

 libview/ev-view-presentation.c |    4 ++--
 libview/ev-view.c              |   18 +++++++++---------
 shell/ev-sidebar-attachments.c |    3 ++-
 shell/ev-sidebar-bookmarks.c   |    3 ++-
 4 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index feee302..98429b6 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -496,7 +496,7 @@ ev_view_presentation_update_current_page (EvViewPresentation *pview,
 	if (pview->cursor != EV_VIEW_CURSOR_HIDDEN) {
 		gint x, y;
 
-		gtk_widget_get_pointer (GTK_WIDGET (pview), &x, &y);
+		ev_document_misc_get_pointer_position (GTK_WIDGET (pview), &x, &y);
 		ev_view_presentation_set_cursor_for_location (pview, x, y);
 	}
 
@@ -1148,7 +1148,7 @@ ev_view_presentation_key_press_event (GtkWidget   *widget,
 
 		ev_view_presentation_goto_window_create (pview);
 		ev_view_presentation_goto_window_send_key_event (pview, (GdkEvent *)event);
-		gtk_widget_get_pointer (GTK_WIDGET (pview), &x, &y);
+		ev_document_misc_get_pointer_position (GTK_WIDGET (pview), &x, &y);
 		gtk_window_move (GTK_WINDOW (pview->goto_window), x, y);
 		gtk_widget_show (pview->goto_window);
 		ev_view_presentation_goto_entry_grab_focus (pview);
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 83fdd4c..1a371d6 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -3005,7 +3005,7 @@ ev_view_cancel_add_annotation (EvView *view)
 		return;
 
 	view->adding_annot = FALSE;
-	gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+	ev_document_misc_get_pointer_position (GTK_WIDGET (view), &x, &y);
 	ev_view_handle_cursor_over_xy (view, x, y);
 }
 
@@ -3495,8 +3495,8 @@ static gboolean
 ev_view_popup_menu (GtkWidget *widget)
 {
 	gint x, y;
-	
-	gtk_widget_get_pointer (widget, &x, &y);
+
+	ev_document_misc_get_pointer_position (widget, &x, &y);
 	return ev_view_do_popup_menu (EV_VIEW (widget), x, y);
 }
 
@@ -3819,7 +3819,7 @@ selection_scroll_timeout_cb (EvView *view)
 	GtkAllocation allocation;
 
 	gtk_widget_get_allocation (widget, &allocation);
-	gtk_widget_get_pointer (widget, &x, &y);
+	ev_document_misc_get_pointer_position (widget, &x, &y);
 
 	if (y > allocation.height) {
 		shift = (y - allocation.height) / 2;
@@ -3937,7 +3937,7 @@ ev_view_motion_notify_event (GtkWidget      *widget,
 	window = gtk_widget_get_window (widget);
 
         if (event->is_hint || event->window != window) {
-	    gtk_widget_get_pointer (widget, &x, &y);
+	    ev_document_misc_get_pointer_position (widget, &x, &y);
         } else {
 	    x = event->x;
 	    y = event->y;
@@ -4974,7 +4974,7 @@ ev_view_change_page (EvView *view,
 
 	hide_loading_window (view);
 
-	gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+	ev_document_misc_get_pointer_position (GTK_WIDGET (view), &x, &y);
 	ev_view_handle_cursor_over_xy (view, x, y);
 
 	gtk_widget_queue_resize (GTK_WIDGET (view));
@@ -5062,7 +5062,7 @@ on_adjustment_value_changed (GtkAdjustment *adjustment,
 		gdk_window_scroll (gtk_widget_get_window (widget), dx, dy);
 	}
 
-	gtk_widget_get_pointer (widget, &x, &y);
+	ev_document_misc_get_pointer_position (widget, &x, &y);
 	ev_view_handle_cursor_over_xy (view, x, y);
 
 	if (view->document)
@@ -5200,7 +5200,7 @@ ev_view_autoscroll_start (EvView *view)
 		g_timeout_add (20, (GSourceFunc)ev_view_autoscroll_cb,
 			       view);
 	
-	gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+	ev_document_misc_get_pointer_position (GTK_WIDGET (view), &x, &y);
 	ev_view_handle_cursor_over_xy (view, x, y);
 }
 
@@ -5220,7 +5220,7 @@ ev_view_autoscroll_stop (EvView *view)
 		view->scroll_info.timeout_id = 0;
 	}
 
-	gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+	ev_document_misc_get_pointer_position (GTK_WIDGET (view), &x, &y);
 	ev_view_handle_cursor_over_xy (view, x, y);
 }
 
diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c
index 5b71789..3d5202f 100644
--- a/shell/ev-sidebar-attachments.c
+++ b/shell/ev-sidebar-attachments.c
@@ -32,6 +32,7 @@
 #include <gtk/gtk.h>
 
 #include "ev-document-attachments.h"
+#include "ev-document-misc.h"
 #include "ev-jobs.h"
 #include "ev-job-scheduler.h"
 #include "ev-file-helpers.h"
@@ -263,7 +264,7 @@ ev_sidebar_attachments_popup_menu (GtkWidget *widget)
 	EvSidebarAttachments *ev_attachbar = EV_SIDEBAR_ATTACHMENTS (widget);
 	gint                  x, y;
 
-	gtk_widget_get_pointer (widget, &x, &y);
+	ev_document_misc_get_pointer_position (widget, &x, &y);
 
 	return ev_sidebar_attachments_popup_menu_show (ev_attachbar, x, y);
 }
diff --git a/shell/ev-sidebar-bookmarks.c b/shell/ev-sidebar-bookmarks.c
index fa252d8..aadded0 100644
--- a/shell/ev-sidebar-bookmarks.c
+++ b/shell/ev-sidebar-bookmarks.c
@@ -25,6 +25,7 @@
 #include "ev-sidebar-bookmarks.h"
 
 #include "ev-document.h"
+#include "ev-document-misc.h"
 #include "ev-sidebar-page.h"
 #include "ev-utils.h"
 
@@ -378,7 +379,7 @@ ev_sidebar_bookmarks_popup_menu (GtkWidget *widget)
         EvSidebarBookmarks *sidebar_bookmarks = EV_SIDEBAR_BOOKMARKS (widget);
         gint                x, y;
 
-        gtk_widget_get_pointer (widget, &x, &y);
+        ev_document_misc_get_pointer_position (widget, &x, &y);
         return ev_sidebar_bookmarks_popup_menu_show (sidebar_bookmarks, x, y, TRUE);
 }
 



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