[gtk/wip/matthiasc/popup5: 187/234] Add a GdkSurface::parent property



commit e3043c7ea763e2d9c3e95fd1c56e7233408e5e2c
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 12106c5d60..87bea23ee1 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,
@@ -437,6 +438,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"),
@@ -633,6 +641,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;
@@ -665,6 +677,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 beea0dcdcd..b3dafbaf4f 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]