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.
This commit is contained in:
Carlos Garnacho 2018-11-30 20:35:15 +01:00 committed by Jonas Ådahl
parent f6f188dad4
commit f8cd1e55a4
2 changed files with 9 additions and 5 deletions

View File

@ -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,

View File

@ -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
{