[gtk/wip/otte/for-master] x11: Don't try to move destroyed windows




commit f40ce51a13797253ef99d871e1e8ffc0ca637e0f
Author: Benjamin Otte <otte redhat com>
Date:   Mon Oct 11 19:22:46 2021 +0200

    x11: Don't try to move destroyed windows
    
    Fixes BadWindow crashes when the resize happen right when tooltips or
    other such transient popups were in the process of being destroyed.

 gdk/x11/gdksurface-x11.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 16e1a3678d..4e2c2e9e11 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -1926,8 +1926,13 @@ gdk_x11_surface_update_popups (GdkSurface *parent)
     {
       GdkX11Surface *popup_impl = l->data;
       GdkSurface *popup = GDK_SURFACE (popup_impl);
-      int new_x = GDK_X11_SURFACE (parent)->abs_x + popup->x;
-      int new_y = GDK_X11_SURFACE (parent)->abs_y + popup->y;
+      int new_x, new_y;
+
+      if (GDK_SURFACE_DESTROYED (popup))
+        continue;
+
+      new_x = GDK_X11_SURFACE (parent)->abs_x + popup->x;
+      new_y = GDK_X11_SURFACE (parent)->abs_y + popup->y;
 
       if (new_x != popup_impl->abs_x || new_y != popup_impl->abs_y)
         x11_surface_move (popup, new_x, new_y);


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