[gtk/wip/matthiasc/popup5: 101/115] Add a GdkSurface::parent property



commit 389c3b53d65136942233a29c9105460474c835c8
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 4471ef7306..4ed411f68c 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -524,6 +524,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);
 
@@ -541,7 +542,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]