[gtk/wip/matthiasc/popup5: 112/120] Add a GdkSurface::parent property



commit f8bdfbce89afc686a34deb13e1ad03013f27c4eb
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed May 8 04:36:59 2019 +0000

    Add a GdkSurface::parent property

 gdk/gdksurface.c                 | 16 ++++++++++++++++
 gdk/wayland/gdksurface-wayland.c |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index dbca6c3fee..e999d57d9f 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -79,6 +79,7 @@ enum {
   PROP_0,
   PROP_CURSOR,
   PROP_DISPLAY,
+  PROP_PARENT,
   PROP_FRAME_CLOCK,
   PROP_STATE,
   PROP_MAPPED,
@@ -436,6 +437,13 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
                            GDK_TYPE_DISPLAY,
                            G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
 
+  properties[PROP_PARENT] =
+      g_param_spec_object ("parent",
+                           P_("Parent"),
+                           P_("Parent surface"),
+                           GDK_TYPE_SURFACE,
+                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
   properties[PROP_FRAME_CLOCK] =
       g_param_spec_object ("frame-clock",
                            P_("Frame Clock"),
@@ -625,6 +633,10 @@ gdk_surface_set_property (GObject      *object,
       g_assert (surface->display != NULL);
       break;
 
+    case PROP_PARENT:
+      surface->parent = g_value_dup_object (value);
+      break;
+
     case PROP_FRAME_CLOCK:
       gdk_surface_set_frame_clock (surface, GDK_FRAME_CLOCK (g_value_get_object (value)));
       break;
@@ -653,6 +665,10 @@ gdk_surface_get_property (GObject    *object,
       g_value_set_object (value, surface->display);
       break;
 
+    case PROP_PARENT:
+      g_value_set_object (value, surface->parent);
+      break;
+
     case PROP_FRAME_CLOCK:
       g_value_set_object (value, surface->frame_clock);
       break;
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 88989496a4..6d670697cb 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -517,6 +517,7 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
 
   surface = g_object_new (GDK_TYPE_WAYLAND_SURFACE,
                           "display", display,
+                          "parent", parent,
                           "frame-clock", frame_clock,
                           NULL);
 
@@ -534,7 +535,6 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
     }
 
   surface->surface_type = surface_type;
-  surface->parent = parent;
   surface->x = x;
   surface->y = y;
   surface->width = width;


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