[gtk/matthiasc/for-master: 3/5] wayland: Don't send invalid anchor rectangles




commit a85fc0008c9618b4999f3851ffb9ff01db2a03dc
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 9 16:00:19 2020 -0400

    wayland: Don't send invalid anchor rectangles
    
    When we send an anchor rectangle with a width or
    height of 0, mutter reponds with "Invalid anchor
    rectangle size". So, don't do that.
    
    This was seen as sudden disappearance of gtk4-demo
    when you click the fishbowl benchmark all the way
    through to the menubuttons.
    
    Fixes: #3027

 gdk/wayland/gdksurface-wayland.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 46dd4a3284..a7ecb7b19b 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -2318,8 +2318,8 @@ create_dynamic_positioner (GdkSurface     *surface,
   real_anchor_rect_x = anchor_rect->x - parent->shadow_left;
   real_anchor_rect_y = anchor_rect->y - parent->shadow_top;
 
-  anchor_rect_width = anchor_rect->width;
-  anchor_rect_height = anchor_rect->height;
+  anchor_rect_width = MAX (anchor_rect->width, 1);
+  anchor_rect_height = MAX (anchor_rect->height, 1);
 
   gdk_popup_layout_get_offset (layout, &rect_anchor_dx, &rect_anchor_dy);
 


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