[gtk/wip/carlosg/text-handle-natives: 684/685] gtkpopover: Ensure the pointed to rectangle has a minimum w/h



commit b6a0cd50cd1f8f0bd1453cd73b4d51a0c441c266
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Feb 27 18:07:38 2020 +0100

    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.

 gtk/gtkpopover.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 404bdc9b1d..85c280c484 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1608,6 +1608,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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]