[gtk/present-toplevel-2: 62/71] window: Use toplevel api for decorations and functions



commit 37e4349380fe3dd1c605e0fa9cf55c2c1cc9570a
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Mar 3 12:20:10 2020 -0800

    window: Use toplevel api for decorations and functions

 gtk/gtkwindow.c | 16 ++++++++--------
 tests/testgtk.c |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 9791e49706..ac3b2f9fbc 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -3825,12 +3825,12 @@ gtk_window_set_decorated (GtkWindow *window,
       if (priv->decorated)
         {
           if (priv->client_decorated)
-            gdk_surface_set_decorations (priv->surface, 0);
+            gdk_toplevel_set_decorations (GDK_TOPLEVEL (priv->surface), 0);
           else
-            gdk_surface_set_decorations (priv->surface, GDK_DECOR_ALL);
+            gdk_toplevel_set_decorations (GDK_TOPLEVEL (priv->surface), GDK_DECOR_ALL);
         }
       else
-        gdk_surface_set_decorations (priv->surface, 0);
+        gdk_toplevel_set_decorations (GDK_TOPLEVEL (priv->surface), 0);
     }
 
   update_window_buttons (window);
@@ -3892,10 +3892,10 @@ gtk_window_set_deletable (GtkWindow *window,
   if (priv->surface)
     {
       if (priv->deletable)
-        gdk_surface_set_functions (priv->surface, GDK_FUNC_ALL);
+        gdk_toplevel_set_functions (GDK_TOPLEVEL (priv->surface), GDK_FUNC_ALL);
       else
-        gdk_surface_set_functions (priv->surface,
-                                  GDK_FUNC_ALL | GDK_FUNC_CLOSE);
+        gdk_toplevel_set_functions (GDK_TOPLEVEL (priv->surface),
+                                   GDK_FUNC_ALL | GDK_FUNC_CLOSE);
     }
 
   update_window_buttons (window);
@@ -5575,7 +5575,7 @@ gtk_window_realize (GtkWidget *widget)
     gdk_toplevel_set_title (GDK_TOPLEVEL (surface), priv->title);
 
   if (!priv->decorated || priv->client_decorated)
-    gdk_surface_set_decorations (surface, 0);
+    gdk_toplevel_set_decorations (GDK_TOPLEVEL (surface), 0);
 
 #ifdef GDK_WINDOWING_WAYLAND
   if (priv->client_decorated && GDK_IS_WAYLAND_SURFACE (surface))
@@ -5583,7 +5583,7 @@ gtk_window_realize (GtkWidget *widget)
 #endif
 
   if (!priv->deletable)
-    gdk_surface_set_functions (surface, GDK_FUNC_ALL | GDK_FUNC_CLOSE);
+    gdk_toplevel_set_functions (GDK_TOPLEVEL (surface), GDK_FUNC_ALL | GDK_FUNC_CLOSE);
 
   gdk_toplevel_set_accept_focus (GDK_TOPLEVEL (surface),
                                  gtk_window_get_accept_focus (window));
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 67f649b1aa..ee0aeada1c 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -4682,8 +4682,8 @@ create_wmhints (GtkWidget *widget)
       g_object_unref (texture);
       g_object_unref (pixbuf);
 
-      gdk_surface_set_decorations (gdk_surface, GDK_DECOR_ALL | GDK_DECOR_MENU);
-      gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL | GDK_FUNC_RESIZE);
+      gdk_toplevel_set_decorations (GDK_TOPLEVEL (gdk_surface), GDK_DECOR_ALL | GDK_DECOR_MENU);
+      gdk_toplevel_set_functions (GDK_TOPLEVEL (gdk_surface), GDK_FUNC_ALL | GDK_FUNC_RESIZE);
 
       box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
       gtk_container_add (GTK_CONTAINER (window), box1);


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