[gnome-packagekit] Port away from the deprecated gdk_window_get_pointer()



commit 536a1e91f2cdd87d37c7805e32adbf95c3f139c8
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jun 26 11:09:31 2012 +0100

    Port away from the deprecated gdk_window_get_pointer()

 src/gpk-update-viewer.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index 10a5031..c01423b 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -3008,11 +3008,20 @@ gpk_update_viewer_textview_visibility_notify_event (GtkWidget *text_view, GdkEve
 {
 	gint wx, wy, bx, by;
 	GdkWindow *window;
+	GdkDevice *device;
 
 	window = gtk_widget_get_window (text_view);
-	gdk_window_get_pointer (window, &wx, &wy, NULL);
+	device = gdk_event_get_device ((const GdkEvent *) event);
+	if (device == NULL)
+		goto out;
+	gdk_window_get_device_position (window,
+					device,
+					&wx, &wy,
+					NULL);
+
 	gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), GTK_TEXT_WINDOW_WIDGET, wx, wy, &bx, &by);
 	gpk_update_viewer_textview_set_cursor (GTK_TEXT_VIEW (text_view), bx, by);
+out:
 	return FALSE;
 }
 



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