From f8cd1e55a43939552361ef26a13e6faa1da59c47 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 30 Nov 2018 20:35:15 +0100 Subject: [PATCH] wayland: Make DnD role inherit from MetaWaylandActorSurface It is meant to hold surfaces that require a ClutterActor, just like wl/xdg shell surfaces and subsurfaces. Make it inherit from MetaWaylandActorSurface so it gets that for free. The type declaration is also made completely private, in order to avoid cyclic dependency between meta-wayland-surface.h and meta-wayland-actor-surface.h. We just require the GType fro assign_role() anyway. --- src/wayland/meta-wayland-surface.c | 8 +++++++- src/wayland/meta-wayland-surface.h | 6 ++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 8e12a7bb9..d8d561901 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -39,6 +39,7 @@ #include "compositor/region-utils.h" #include "core/display-private.h" #include "core/window-private.h" +#include "wayland/meta-wayland-actor-surface.h" #include "wayland/meta-wayland-buffer.h" #include "wayland/meta-wayland-data-device.h" #include "wayland/meta-wayland-gtk-shell.h" @@ -91,9 +92,14 @@ struct _MetaWaylandSurfaceRoleDND MetaWaylandSurfaceRole parent; }; +G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleDND, + meta_wayland_surface_role_dnd, + META, WAYLAND_SURFACE_ROLE_DND, + MetaWaylandActorSurface); + G_DEFINE_TYPE (MetaWaylandSurfaceRoleDND, meta_wayland_surface_role_dnd, - META_TYPE_WAYLAND_SURFACE_ROLE); + META_TYPE_WAYLAND_ACTOR_SURFACE); enum { SURFACE_DESTROY, diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index f84d88061..dd8009b8b 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -70,10 +70,8 @@ struct _MetaWaylandSerial { }; #define META_TYPE_WAYLAND_SURFACE_ROLE_DND (meta_wayland_surface_role_dnd_get_type ()) -G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleDND, - meta_wayland_surface_role_dnd, - META, WAYLAND_SURFACE_ROLE_DND, - MetaWaylandSurfaceRole); + +GType meta_wayland_surface_role_dnd_get_type (void); struct _MetaWaylandPendingState {