diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c index db46f56f87..6c3af4c95a 100644 --- a/gdk/broadway/gdksurface-broadway.c +++ b/gdk/broadway/gdksurface-broadway.c @@ -209,13 +209,13 @@ _gdk_broadway_display_create_surface (GdkDisplay *display, frame_clock = _gdk_frame_clock_idle_new (); surface = g_object_new (GDK_TYPE_BROADWAY_SURFACE, + "surface-type", surface_type, "display", display, "frame-clock", frame_clock, NULL); g_object_unref (frame_clock); - surface->surface_type = surface_type; surface->parent = parent; surface->x = x; surface->y = y; diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 94de885ef2..281ac8b034 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -77,6 +77,7 @@ enum { enum { PROP_0, + PROP_SURFACE_TYPE, PROP_CURSOR, PROP_DISPLAY, PROP_PARENT, @@ -473,6 +474,13 @@ gdk_surface_class_init (GdkSurfaceClass *klass) FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + properties[PROP_SURFACE_TYPE] = + g_param_spec_enum ("surface-type", + P_("Surface type"), + P_("Surface type"), + GDK_TYPE_SURFACE_TYPE, GDK_SURFACE_TOPLEVEL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + g_object_class_install_properties (object_class, LAST_PROP, properties); /** @@ -659,6 +667,10 @@ gdk_surface_set_property (GObject *object, surface->autohide = g_value_get_boolean (value); break; + case PROP_SURFACE_TYPE: + surface->surface_type = g_value_get_enum (value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -703,6 +715,10 @@ gdk_surface_get_property (GObject *object, g_value_set_boolean (value, surface->autohide); break; + case PROP_SURFACE_TYPE: + g_value_set_enum (value, surface->surface_type); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index b3dafbaf4f..f7bd5c9f9d 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -516,6 +516,7 @@ _gdk_wayland_display_create_surface (GdkDisplay *display, frame_clock = _gdk_frame_clock_idle_new (); surface = g_object_new (GDK_TYPE_WAYLAND_SURFACE, + "surface-type", surface_type, "display", display, "parent", parent, "frame-clock", frame_clock, @@ -534,7 +535,6 @@ _gdk_wayland_display_create_surface (GdkDisplay *display, height = 65535; } - surface->surface_type = surface_type; surface->x = x; surface->y = y; surface->width = width; diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index 64a1d11cca..dc12f44f0a 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -820,13 +820,13 @@ _gdk_x11_display_create_surface (GdkDisplay *display, frame_clock = _gdk_frame_clock_idle_new (); surface = g_object_new (GDK_TYPE_X11_SURFACE, + "surface-type", surface_type, "display", display, "frame-clock", frame_clock, NULL); g_object_unref (frame_clock); - surface->surface_type = surface_type; surface->parent = parent; surface->x = x; surface->y = y;