[gtk/wip/matthiasc/popup5: 44/75] surface: Make gdk_surface_get_device_position void



commit fefd0ab788f058062c56334f95d5742fcf890298
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 19 15:39:23 2019 -0400

    surface: Make gdk_surface_get_device_position void
    
    None of the callers were using the return value,
    and without child surfaces, it is not very useful.

 gdk/gdksurface.c | 14 ++++----------
 gdk/gdksurface.h | 10 +++++-----
 2 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 0a7cc780f9..a3024978bd 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1479,12 +1479,8 @@ gdk_surface_constrain_size (GdkGeometry    *geometry,
  * Obtains the current device position in doubles and modifier state.
  * The position is given in coordinates relative to the upper left
  * corner of @surface.
- *
- * Returns: (nullable) (transfer none): The surface underneath @device
- * (as with gdk_device_get_surface_at_position()), or %NULL if the
- * surface is not known to GDK.
  **/
-GdkSurface *
+void
 gdk_surface_get_device_position (GdkSurface       *surface,
                                  GdkDevice       *device,
                                  double          *x,
@@ -1494,9 +1490,9 @@ gdk_surface_get_device_position (GdkSurface       *surface,
   gdouble tmp_x, tmp_y;
   GdkModifierType tmp_mask;
 
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-  g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
-  g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
+  g_return_if_fail (GDK_IS_SURFACE (surface));
+  g_return_if_fail (GDK_IS_DEVICE (device));
+  g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
 
   tmp_x = tmp_y = 0;
   tmp_mask = 0;
@@ -1511,8 +1507,6 @@ gdk_surface_get_device_position (GdkSurface       *surface,
     *y = tmp_y;
   if (mask)
     *mask = tmp_mask;
-
-  return NULL;
 }
 
 static void
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index c39fc885b6..d64c63dd18 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -598,11 +598,11 @@ GDK_AVAILABLE_IN_ALL
 gint          gdk_surface_get_scale_factor  (GdkSurface     *surface);
 
 GDK_AVAILABLE_IN_ALL
-GdkSurface *   gdk_surface_get_device_position (GdkSurface      *surface,
-                                                GdkDevice       *device,
-                                                double          *x,
-                                                double          *y,
-                                                GdkModifierType *mask);
+void          gdk_surface_get_device_position (GdkSurface      *surface,
+                                               GdkDevice       *device,
+                                               double          *x,
+                                               double          *y,
+                                               GdkModifierType *mask);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_set_icon_list   (GdkSurface       *surface,
                                            GList           *surfaces);


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