Add a warning when a grab fails

This reveals that the grabs for popover menus
always fail now, causing the menus to not properly
hide.
This commit is contained in:
Matthias Clasen 2020-02-21 22:03:28 -05:00
parent 3eea9f3e79
commit 76e115b910

View File

@ -2799,18 +2799,28 @@ gdk_wayland_surface_present_popup (GdkSurface *surface,
if (surface->autohide) if (surface->autohide)
{ {
GrabPrepareData data; GrabPrepareData data;
GdkGrabStatus result;
data = (GrabPrepareData) { data = (GrabPrepareData) {
.width = width, .width = width,
.height = height, .height = height,
.layout = layout, .layout = layout,
}; };
gdk_seat_grab (gdk_display_get_default_seat (surface->display),
surface, result = gdk_seat_grab (gdk_display_get_default_seat (surface->display),
GDK_SEAT_CAPABILITY_ALL, surface,
TRUE, GDK_SEAT_CAPABILITY_ALL,
NULL, NULL, TRUE,
show_grabbing_popup, &data); NULL, NULL,
show_grabbing_popup, &data);
if (result != GDK_GRAB_SUCCESS)
{
const char *grab_status[] = {
"success", "already grabbed", "invalid time",
"not viewable", "frozen", "failed"
};
g_warning ("Grab failed: %s", grab_status[result]);
}
} }
else else
{ {