[gtk/wip/matthiasc/popup4: 78/140] surface: Make gdk_surface_get_device_position void
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup4: 78/140] surface: Make gdk_surface_get_device_position void
- Date: Mon, 29 Apr 2019 02:48:15 +0000 (UTC)
commit c77fa1f2dd2a07e5ee10df7bd76a2a5d8635fb77
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 4ec3d9c635..87c9e4aac2 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1463,12 +1463,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,
@@ -1478,9 +1474,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;
@@ -1495,8 +1491,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]