[nautilus] all: don't use deprecated GDK pointer methods
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] all: don't use deprecated GDK pointer methods
- Date: Tue, 18 Oct 2011 15:28:36 +0000 (UTC)
commit a816e00ef769a3be12a053a29e41f3da1b91c492
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Oct 18 11:24:38 2011 -0400
all: don't use deprecated GDK pointer methods
Use the new GdkDevice methods instead.
eel/eel-editable-label.c | 7 ++++---
libnautilus-private/nautilus-dnd.c | 7 ++++++-
libnautilus-private/nautilus-tree-view-drag-dest.c | 9 +++++++--
src/nautilus-notebook.c | 7 ++++++-
4 files changed, 23 insertions(+), 7 deletions(-)
---
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index b21b19b..2232685 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1902,9 +1902,10 @@ eel_editable_label_motion (GtkWidget *widget,
if ((event->state & GDK_BUTTON1_MASK) == 0)
return FALSE;
- gdk_window_get_pointer (gtk_widget_get_window (widget),
- &x, &y, NULL);
-
+ gdk_window_get_device_position (gtk_widget_get_window (widget),
+ event->device,
+ &x, &y, NULL);
+
get_layout_index (label, x, y, &index);
eel_editable_label_select_region_index (label,
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c
index 9c5cc0c..72cde45 100644
--- a/libnautilus-private/nautilus-dnd.c
+++ b/libnautilus-private/nautilus-dnd.c
@@ -833,11 +833,16 @@ void
nautilus_drag_autoscroll_calculate_delta (GtkWidget *widget, float *x_scroll_delta, float *y_scroll_delta)
{
GtkAllocation allocation;
+ GdkDeviceManager *manager;
+ GdkDevice *pointer;
int x, y;
g_assert (GTK_IS_WIDGET (widget));
- gdk_window_get_pointer (gtk_widget_get_window (widget), &x, &y, NULL);
+ manager = gdk_display_get_device_manager (gtk_widget_get_display (widget));
+ pointer = gdk_device_manager_get_client_pointer (manager);
+ gdk_window_get_device_position (gtk_widget_get_window (widget), pointer,
+ &x, &y, NULL);
/* Find out if we are anywhere close to the tree view edges
* to see if we need to autoscroll.
diff --git a/libnautilus-private/nautilus-tree-view-drag-dest.c b/libnautilus-private/nautilus-tree-view-drag-dest.c
index 117c027..fcd9b98 100644
--- a/libnautilus-private/nautilus-tree-view-drag-dest.c
+++ b/libnautilus-private/nautilus-tree-view-drag-dest.c
@@ -97,6 +97,8 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
{
GdkRectangle visible_rect;
GtkAdjustment *vadjustment;
+ GdkDeviceManager *manager;
+ GdkDevice *pointer;
GdkWindow *window;
int y;
int offset;
@@ -104,8 +106,11 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
window = gtk_tree_view_get_bin_window (tree_view);
vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (tree_view));
-
- gdk_window_get_pointer (window, NULL, &y, NULL);
+
+ manager = gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (tree_view)));
+ pointer = gdk_device_manager_get_client_pointer (manager);
+ gdk_window_get_device_position (window, pointer,
+ NULL, &y, NULL);
y += gtk_adjustment_get_value (vadjustment);
diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c
index e4794f1..3122dd1 100644
--- a/src/nautilus-notebook.c
+++ b/src/nautilus-notebook.c
@@ -99,12 +99,17 @@ nautilus_notebook_class_init (NautilusNotebookClass *klass)
static NautilusNotebook *
find_notebook_at_pointer (gint abs_x, gint abs_y)
{
+ GdkDeviceManager *manager;
+ GdkDevice *pointer;
GdkWindow *win_at_pointer, *toplevel_win;
gpointer toplevel = NULL;
gint x, y;
/* FIXME multi-head */
- win_at_pointer = gdk_window_at_pointer (&x, &y);
+ manager = gdk_display_get_device_manager (gdk_display_get_default ());
+ pointer = gdk_device_manager_get_client_pointer (manager);
+ win_at_pointer = gdk_device_get_window_at_position (pointer, &x, &y);
+
if (win_at_pointer == NULL)
{
/* We are outside all windows containing a notebook */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]