[gtk/gtk-3-24: 1/5] wayland/window: Don't remap when handling xdg_popu.configure



commit 66ee4dea40445441bbdac2750f4a8c733356fce4
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu Jan 17 16:17:32 2019 +0100

    wayland/window: Don't remap when handling xdg_popu.configure
    
    If the size was constrained by the xdg_positioner mechanisms, we handle
    the resize by resizing the popup window. What we shouldn't do is
    hide/show the popup window so avoid that.

 gdk/wayland/gdkwindow-wayland.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index a5f9d44912..91e01e1d90 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -140,6 +140,7 @@ struct _GdkWindowImplWayland
   EGLSurface dummy_egl_surface;
 
   unsigned int initial_configure_received : 1;
+  unsigned int configuring_popup : 1;
   unsigned int mapped : 1;
   unsigned int use_custom_surface : 1;
   unsigned int pending_buffer_attached : 1;
@@ -1088,12 +1089,18 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
   is_xdg_popup = is_realized_popup (window);
   is_visible = gdk_window_is_visible (window);
 
-  if (is_xdg_popup && is_visible && !impl->initial_configure_received)
+  if (is_xdg_popup &&
+      is_visible &&
+      !impl->initial_configure_received &&
+      !impl->configuring_popup)
     gdk_window_hide (window);
 
   gdk_wayland_window_configure (window, width, height, scale);
 
-  if (is_xdg_popup && is_visible && !impl->initial_configure_received)
+  if (is_xdg_popup &&
+      is_visible &&
+      !impl->initial_configure_received &&
+      !impl->configuring_popup)
     gdk_window_show (window);
 }
 
@@ -2413,9 +2420,11 @@ calculate_moved_to_rect_result (GdkWindow    *window,
   window_width = width + window->shadow_left + window->shadow_right;
   window_height = height + window->shadow_top + window->shadow_bottom;
 
+  impl->configuring_popup = TRUE;
   gdk_window_move_resize (window,
                           window_x, window_y,
                           window_width, window_height);
+  impl->configuring_popup = FALSE;
 
   calculate_popup_rect (window,
                         impl->pending_move_to_rect.rect_anchor,


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