[gtkglarea/jjardon/gtk3: 12/16] examples: replace use of deprecated gdk_window_get_pointer()



commit 5650c4af146cc4bccde71f2d3cb6176246972cbf
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Mar 24 18:32:51 2014 +0000

    examples: replace use of deprecated gdk_window_get_pointer()

 examples/gtkglarea_demo.c |    4 +++-
 examples/viewlw.c         |    7 +++----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/examples/gtkglarea_demo.c b/examples/gtkglarea_demo.c
index 376efdd..ab67ba9 100644
--- a/examples/gtkglarea_demo.c
+++ b/examples/gtkglarea_demo.c
@@ -272,7 +272,9 @@ gint glarea_motion_notify (GtkWidget* widget, GdkEventMotion* event) {
   GdkModifierType state;
 
   if (event->is_hint) {
-    gdk_window_get_pointer(event->window, &x, &y, &state);
+    GdkWindow *window = gdk_event_get_window ((GdkEvent *)event);
+    GdkDevice *device = gdk_event_get_device ((GdkEvent *)event);
+    gdk_window_get_device_position (window, device, &x, &y, &state);
   } else {
     x = event->x;
     y = event->y;
diff --git a/examples/viewlw.c b/examples/viewlw.c
index f3862ab..1da4d01 100644
--- a/examples/viewlw.c
+++ b/examples/viewlw.c
@@ -175,10 +175,9 @@ gint glarea_motion_notify(GtkWidget *widget, GdkEventMotion *event)
   mesh_info *info = (mesh_info*) g_object_get_data(G_OBJECT (widget), "mesh_info");
 
   if (event->is_hint) {
-    /* fix this! */
-#if !defined(WIN32)
-    gdk_window_get_pointer(event->window, &x, &y, &state);
-#endif
+    GdkWindow *window = gdk_event_get_window ((GdkEvent *)event);
+    GdkDevice *device = gdk_event_get_device ((GdkEvent *)event);
+    gdk_window_get_device_position (window, device, &x, &y, &state);
   } else {
     x = event->x;
     y = event->y;


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