Merge branch 'surface-get-mapped' into 'master'

Add gdk_surface_get_mapped

See merge request GNOME/gtk!1473
This commit is contained in:
Matthias Clasen
2020-02-25 00:26:42 +00:00
8 changed files with 15 additions and 14 deletions

View File

@@ -185,8 +185,8 @@ gdk_surface_show
gdk_surface_show_unraised
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

View File

@@ -119,14 +119,14 @@ gdk_seat_default_grab (GdkSeat *seat,
gboolean was_visible;
priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
was_visible = gdk_surface_is_visible (surface);
was_visible = gdk_surface_get_mapped (surface);
if (prepare_func)
(prepare_func) (seat, surface, prepare_func_data);
if (!gdk_surface_is_visible (surface))
if (!gdk_surface_get_mapped (surface))
{
g_critical ("Surface %p has not been made visible in GdkSeatGrabPrepareFunc",
g_critical ("Surface %p has not been mapped in GdkSeatGrabPrepareFunc",
surface);
return GDK_GRAB_NOT_VIEWABLE;
}

View File

@@ -1024,7 +1024,7 @@ gdk_surface_get_position (GdkSurface *surface,
}
/**
* gdk_surface_is_visible:
* gdk_surface_get_mapped:
* @surface: a #GdkSurface
*
* Checks whether the surface has been mapped (with gdk_surface_show() or
@@ -1033,7 +1033,7 @@ gdk_surface_get_position (GdkSurface *surface,
* Returns: %TRUE if the surface is mapped
**/
gboolean
gdk_surface_is_visible (GdkSurface *surface)
gdk_surface_get_mapped (GdkSurface *surface)
{
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);

View File

@@ -403,11 +403,12 @@ void gdk_surface_input_shape_combine_region (GdkSurface *surface,
gint offset_x,
gint offset_y);
GDK_AVAILABLE_IN_ALL
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);

View File

@@ -750,7 +750,7 @@ gdk_wayland_device_grab (GdkDevice *device,
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
if (gdk_surface_get_surface_type (surface) == GDK_SURFACE_TEMP &&
gdk_surface_is_visible (surface))
gdk_surface_get_mapped (surface))
{
g_warning ("Surface %p is already mapped at the time of grabbing. "
"gdk_seat_grab() should be used to simultanously grab input "
@@ -4502,7 +4502,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
if (prepare_func)
(prepare_func) (seat, surface, prepare_func_data);
if (!gdk_surface_is_visible (surface))
if (!gdk_surface_get_mapped (surface))
{
gdk_wayland_seat_set_grab_surface (wayland_seat, NULL);
return GDK_GRAB_NOT_VIEWABLE;

View File

@@ -864,7 +864,7 @@ gdk_wayland_surface_maybe_resize (GdkSurface *surface,
*/
is_xdg_popup = is_realized_popup (surface);
is_visible = gdk_surface_is_visible (surface);
is_visible = gdk_surface_get_mapped (surface);
if (is_xdg_popup && is_visible && !impl->initial_configure_received)
gdk_wayland_surface_hide (surface);

View File

@@ -543,7 +543,7 @@ gdk_surface_cache_new (GdkDisplay *display)
x * impl->surface_scale, y * impl->surface_scale,
width * impl->surface_scale,
height * impl->surface_scale,
gdk_surface_is_visible (surface));
gdk_surface_get_mapped (surface));
}
return result;
}

View File

@@ -826,7 +826,7 @@ surface_transform_changed_cb (GtkWidget *widget,
GtkPopover *popover = user_data;
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
if (priv->surface && gdk_surface_is_visible (priv->surface))
if (priv->surface && gdk_surface_get_mapped (priv->surface))
present_popup (popover);
return G_SOURCE_CONTINUE;
@@ -1567,7 +1567,7 @@ relative_to_size_changed (GtkWidget *widget,
{
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
if (priv->surface && gdk_surface_is_visible (priv->surface))
if (priv->surface && gdk_surface_get_mapped (priv->surface))
present_popup (popover);
}