From 96b7c5f575e6b5512386efdf9e5328024fd53324 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 24 Feb 2020 17:59:12 -0500 Subject: [PATCH] Add gdk_surface_get_mapped Returns the value of the ::mapped property. This is a direct replacement for gtk_surface_is_visible. --- docs/reference/gdk/gdk4-sections.txt | 1 + gdk/gdksurface.c | 17 +++++++++++++++++ gdk/gdksurface.h | 3 +++ 3 files changed, 21 insertions(+) diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index cb090b4f66..b93bdb24c3 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -187,6 +187,7 @@ gdk_surface_hide gdk_surface_is_destroyed gdk_surface_is_visible gdk_surface_is_viewable +gdk_surface_get_mapped gdk_surface_get_state gdk_surface_get_autohide gdk_surface_minimize diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 480a2ff9c3..4fe3da8001 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -1023,6 +1023,23 @@ gdk_surface_get_position (GdkSurface *surface, } } +/** + * gdk_surface_get_mapped: + * @surface: a #GdkSurface + * + * Checks whether the surface has been mapped (with gdk_surface_show() or + * gdk_surface_show_unraised()). + * + * Returns: %TRUE if the surface is mapped + **/ +gboolean +gdk_surface_get_mapped (GdkSurface *surface) +{ + g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE); + + return GDK_SURFACE_IS_MAPPED (surface); +} + /** * gdk_surface_is_visible: * @surface: a #GdkSurface diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h index 623be33c0d..7afb05777f 100644 --- a/gdk/gdksurface.h +++ b/gdk/gdksurface.h @@ -408,6 +408,9 @@ gboolean gdk_surface_is_visible (GdkSurface *surface); GDK_AVAILABLE_IN_ALL gboolean gdk_surface_is_viewable (GdkSurface *surface); +GDK_AVAILABLE_IN_ALL +gboolean gdk_surface_get_mapped (GdkSurface *surface); + GDK_AVAILABLE_IN_ALL gboolean gdk_surface_get_autohide (GdkSurface *surface);