[gtk+/broadway: 216/246] broadway: Call device vfunc to get device state



commit 71aa55d29126f2e3b04caab5804318f6a3fecd1b
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Mar 11 08:26:37 2011 +0100

    broadway: Call device vfunc to get device state
    
    We want only one place where we get device state.

 gdk/broadway/gdkdevice-broadway.c |   10 ++++++++++
 gdk/broadway/gdkwindow-broadway.c |   16 ++++++++++++----
 2 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c
index a3dcab0..0d0aaa9 100644
--- a/gdk/broadway/gdkdevice-broadway.c
+++ b/gdk/broadway/gdkdevice-broadway.c
@@ -152,6 +152,16 @@ gdk_broadway_device_query_state (GdkDevice        *device,
 				 gint             *win_y,
 				 GdkModifierType  *mask)
 {
+  if (root_x)
+    *root_x = 0;
+  if (root_y)
+    *root_y = 0;
+  if (win_x)
+    *win_x = 0;
+  if (win_y)
+    *win_y = 0;
+  if (mask)
+    *mask = 0;
   return FALSE;
 }
 
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 3e23db7..6dc3f68 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -873,10 +873,18 @@ gdk_window_broadway_get_device_state (GdkWindow       *window,
 				      gint            *y,
 				      GdkModifierType *mask)
 {
-  *x = 0;
-  *y = 0;
-  *mask = 0;
-  return FALSE;
+  GdkWindow *child;
+
+  g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE);
+
+  if (GDK_WINDOW_DESTROYED (window))
+    return FALSE;
+
+  GDK_DEVICE_GET_CLASS (device)->query_state (device, window,
+                                              NULL, &child,
+                                              NULL, NULL,
+                                              x, y, mask);
+  return child != NULL;
 }
 
 static GdkEventMask



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