[gitg] [PATCH] gdk_window_get_pointer is deprecated
- From: Conor O'Gorman <i conorogorman net>
- To: gitg-list gnome org
- Cc: Conor O'Gorman <i conorogorman net>
- Subject: [gitg] [PATCH] gdk_window_get_pointer is deprecated
- Date: Fri, 4 May 2012 18:40:58 +0100
Signed-off-by: Conor O'Gorman <i conorogorman net>
---
gitg/gitg-commit-view.c | 12 ++++++++++--
gitg/gitg-dnd.c | 9 ++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/gitg/gitg-commit-view.c b/gitg/gitg-commit-view.c
index bda199e..6b94839 100644
--- a/gitg/gitg-commit-view.c
+++ b/gitg/gitg-commit-view.c
@@ -1114,11 +1114,15 @@ get_info_at_pointer (GitgCommitView *view,
gint height;
gint buf_x;
gint buf_y;
+ GdkDeviceManager *device_manager;
+ GdkDevice *pointer;
/* Get where the pointer really is. */
GdkWindow *win = gtk_text_view_get_window (textview, GTK_TEXT_WINDOW_TEXT);
- gdk_window_get_pointer (win, &x, &y, NULL);
+ device_manager = gdk_display_get_device_manager (gdk_window_get_display (win));
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+ gdk_window_get_device_position (win, pointer, &x, &y, NULL);
width = gdk_window_get_width (win);
height = gdk_window_get_height (win);
@@ -1237,11 +1241,15 @@ gutter_event (GtkWidget *widget,
GitgDiffLineType line_type;
GtkSourceGutter *gutter;
GtkSourceGutterRenderer *renderer_at_pos;
+ GdkDeviceManager *device_manager;
+ GdkDevice *pointer;
/* Get where the pointer really is. */
GdkWindow *win = gtk_text_view_get_window (textview, GTK_TEXT_WINDOW_LEFT);
- gdk_window_get_pointer (win, &x, &y, NULL);
+ device_manager = gdk_display_get_device_manager (gdk_window_get_display (win));
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+ gdk_window_get_device_position (win, pointer, &x, &y, NULL);
width = gdk_window_get_width (win);
height = gdk_window_get_height (win);
diff --git a/gitg/gitg-dnd.c b/gitg/gitg-dnd.c
index 2b6b91b..b41f877 100644
--- a/gitg/gitg-dnd.c
+++ b/gitg/gitg-dnd.c
@@ -512,8 +512,15 @@ vertical_autoscroll (GitgDndData *data)
gint y;
gint offset;
gfloat value;
+ GdkDeviceManager *device_manager;
+ GdkDevice *pointer;
+ GdkWindow *window;
+
+ window = gtk_tree_view_get_bin_window (data->tree_view);
+ device_manager = gdk_display_get_device_manager (gdk_window_get_display (window));
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+ gdk_window_get_device_position (window, pointer, NULL, &y, NULL);
- gdk_window_get_pointer (gtk_tree_view_get_bin_window (data->tree_view), NULL, &y, NULL);
gtk_tree_view_convert_bin_window_to_tree_coords (data->tree_view, 0, y, NULL, &y);
gtk_tree_view_get_visible_rect (data->tree_view, &visible_rect);
--
1.7.9.5
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]