summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-05-29 02:05:40 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-05-29 18:04:08 +0000
commitd515c43dce6ceee629b71b98e4db1d3a3ba1ef5a (patch)
treec714e5fd9b7095a0a8d5347532707cc324eee8c8 /gdk
parent879f22fd27ee90cf6ce770c8bc8092072cb2f0ed (diff)
downloadgtk+-d515c43dce6ceee629b71b98e4db1d3a3ba1ef5a.tar.gz
Make gdk_surface_get_origin internal
We still use this function inside gdk in a number of places, so keep it around.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkdisplay.c1
-rw-r--r--gdk/gdkinternals.h4
-rw-r--r--gdk/gdksurface.c31
-rw-r--r--gdk/gdksurface.h4
4 files changed, 16 insertions, 24 deletions
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 4244490894..2f5d729f79 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -1646,6 +1646,7 @@ gdk_display_get_monitor_at_surface (GdkDisplay *display,
return best;
}
+ /* the fallback implementation requires global coordinates */
gdk_surface_get_geometry (surface, &win.x, &win.y, &win.width, &win.height);
gdk_surface_get_origin (surface, &win.x, &win.y);
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 3b0e78cb49..ad9ca06e05 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -250,6 +250,10 @@ void gdk_surface_get_root_coords (GdkSurface *surface,
gint y,
gint *root_x,
gint *root_y);
+void gdk_surface_get_origin (GdkSurface *surface,
+ gint *x,
+ gint *y);
+
void gdk_surface_get_geometry (GdkSurface *surface,
gint *x,
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 4e5620ff07..ba4c73a72f 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -2419,37 +2419,28 @@ gdk_surface_get_height (GdkSurface *surface)
return surface->height;
}
-/**
+/*
* gdk_surface_get_origin:
* @surface: a #GdkSurface
- * @x: (out) (allow-none): return location for X coordinate
- * @y: (out) (allow-none): return location for Y coordinate
+ * @x: (out): return location for X coordinate
+ * @y: (out): return location for Y coordinate
*
* Obtains the position of a surface in root window coordinates.
* (Compare with gdk_surface_get_position() and
- * gdk_surface_get_geometry() which return the position of a surface
- * relative to its parent surface.)
- *
- * Returns: not meaningful, ignore
+ * gdk_surface_get_geometry() which return the position
+ * of a surface relative to its parent surface.)
*/
-gint
+void
gdk_surface_get_origin (GdkSurface *surface,
- gint *x,
- gint *y)
+ gint *x,
+ gint *y)
{
- gint dummy_x, dummy_y;
-
- g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
-
- gdk_surface_get_root_coords (surface,
- 0, 0,
- x ? x : &dummy_x,
- y ? y : &dummy_y);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- return TRUE;
+ gdk_surface_get_root_coords (surface, 0, 0, x, y);
}
-/**
+/*
* gdk_surface_get_root_coords:
* @surface: a #GdkSurface
* @x: X coordinate in surface
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index 5d0463da0a..c93b3edba4 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -553,10 +553,6 @@ void gdk_surface_get_position (GdkSurface *surface,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-gint gdk_surface_get_origin (GdkSurface *surface,
- gint *x,
- gint *y);
-GDK_AVAILABLE_IN_ALL
gboolean gdk_surface_translate_coordinates (GdkSurface *from,
GdkSurface *to,
double *x,