[gtk: 16/88] wayland/surface: Don't save uninitialized size




commit 289b50785b8be2a70ba4760ed627fa931cd085b1
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Nov 24 22:58:02 2020 +0100

    wayland/surface: Don't save uninitialized size
    
    GdkSurface's are initialized to have the size 1x1, as otherwise we'd
    receive an X11 error, would a corresponding X11 window be created.
    
    This confuses the "saved size" mechanisms in the Wayland backend, as
    treats 0 as uninitialized, and not 1.
    
    Fix this simply not saving size that if it's smaller or equal than 1.

 gdk/wayland/gdksurface-wayland.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index bcbc647a28..16886f5770 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -341,6 +341,9 @@ _gdk_wayland_surface_save_size (GdkSurface *surface)
                         GDK_TOPLEVEL_STATE_TILED))
     return;
 
+  if (surface->width <= 1 || surface->height <= 1)
+    return;
+
   impl->saved_width = surface->width - impl->margin_left - impl->margin_right;
   impl->saved_height = surface->height - impl->margin_top - impl->margin_bottom;
 }


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