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



commit 2aceacc75e7d24e5694b49390172f38605844b6a
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 ef7253d123..c6e2d70e0d 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -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;


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