GdkSeatDefaultPrivate *priv;
guint32 evtime = event ? gdk_event_get_time (event) : GDK_CURRENT_TIME;
GdkGrabStatus status = GDK_GRAB_SUCCESS;
+ gboolean was_visible;
priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
+ was_visible = gdk_surface_is_visible (surface);
if (prepare_func)
(prepare_func) (seat, surface, prepare_func_data);
{
if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD)
gdk_device_ungrab (priv->master_pointer, evtime);
- gdk_surface_hide (surface);
}
}
+ if (status != GDK_GRAB_SUCCESS && !was_visible)
+ gdk_surface_hide (surface);
+
G_GNUC_END_IGNORE_DEPRECATIONS;
return status;