[gtk/matthiasc/surface-state-rework: 70/80] x11/surface: Remember the toplevel layout




commit 1942f6d6d1680cd18cf84450ef7999ee6445d91c
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sat Dec 5 11:30:45 2020 +0100

    x11/surface: Remember the toplevel layout

 gdk/x11/gdksurface-x11.c | 4 ++++
 gdk/x11/gdksurface-x11.h | 2 ++
 2 files changed, 6 insertions(+)
---
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 8c65183f5d..b5db385093 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -1580,6 +1580,7 @@ gdk_x11_surface_hide (GdkSurface *surface)
                                     NextRequest (GDK_SURFACE_XDISPLAY (surface)));
 
   g_clear_handle_id (&impl->compute_size_source_id, g_source_remove);
+  g_clear_pointer (&impl->toplevel_layout, gdk_toplevel_layout_unref);
 
   gdk_x11_surface_withdraw (surface);
 }
@@ -5054,6 +5055,9 @@ gdk_x11_toplevel_present (GdkToplevel       *toplevel,
 
   gdk_x11_surface_unminimize (surface);
 
+  g_clear_pointer (&impl->toplevel_layout, gdk_toplevel_layout_unref);
+  impl->toplevel_layout = gdk_toplevel_layout_copy (layout);
+
   monitor = gdk_display_get_monitor_at_surface (display, surface);
   if (monitor)
     {
diff --git a/gdk/x11/gdksurface-x11.h b/gdk/x11/gdksurface-x11.h
index 994d125036..134ebdf617 100644
--- a/gdk/x11/gdksurface-x11.h
+++ b/gdk/x11/gdksurface-x11.h
@@ -72,6 +72,8 @@ struct _GdkX11Surface
   int unscaled_width;
   int unscaled_height;
 
+  GdkToplevelLayout *toplevel_layout;
+
   struct {
     int configured_width;
     int configured_height;


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