[gtk/present-toplevel-2: 46/71] Implement new toplevel api



commit 79a6f1da96a84492a83116201d2d68f5d66d0297
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Mar 3 08:42:07 2020 -0800

    Implement new toplevel api
    
    We only add gdk_toplevel_minimize as new api, so make
    gdk_toplevel_present unminimize.

 gdk/gdksurface.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index d008aede04..543a902623 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -2033,6 +2033,8 @@ gdk_toplevel_surface_present (GdkToplevel       *toplevel,
   g_return_val_if_fail (surface->surface_type == GDK_SURFACE_TOPLEVEL, FALSE);
   g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), FALSE);
 
+  GDK_SURFACE_GET_CLASS (surface)->unminimize (surface);
+
   gdk_toplevel_layout_get_min_size (layout,
                                     &geometry.min_width,
                                     &geometry.min_height);
@@ -2077,6 +2079,18 @@ gdk_toplevel_surface_present (GdkToplevel       *toplevel,
   return TRUE;
 }
 
+static gboolean
+gdk_toplevel_surface_minimize (GdkToplevel *toplevel)
+{
+  GdkSurface *surface = GDK_SURFACE (toplevel);
+
+  g_return_val_if_fail (surface->surface_type == GDK_SURFACE_TOPLEVEL, FALSE);
+  
+  GDK_SURFACE_GET_CLASS (surface)->minimize (surface);
+
+  return TRUE;
+}
+
 static gboolean
 gdk_toplevel_surface_show_window_menu (GdkToplevel *toplevel,
                                        GdkEvent    *event)
@@ -2092,6 +2106,7 @@ static void
 gdk_surface_toplevel_init (GdkToplevelInterface *iface)
 {
   iface->present = gdk_toplevel_surface_present;
+  iface->minimize = gdk_toplevel_surface_minimize;
   iface->show_window_menu = gdk_toplevel_surface_show_window_menu;
 }
 


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