gtkpopover: Ensure the pointed to rectangle has a minimum w/h

On wayland, protocol errors will be raised if the rectangle width/height
are 0. Avoid that situation so it's valid to all popovers.
This commit is contained in:
Carlos Garnacho 2020-02-27 18:07:38 +01:00
parent 0f73e83f44
commit 6431bdcf91

View File

@ -1650,6 +1650,8 @@ gtk_popover_set_pointing_to (GtkPopover *popover,
{
priv->pointing_to = *rect;
priv->has_pointing_to = TRUE;
priv->pointing_to.width = MAX (priv->pointing_to.width, 1);
priv->pointing_to.height = MAX (priv->pointing_to.height, 1);
}
else
priv->has_pointing_to = FALSE;