[mutter/wip/carlos/fix-dnd-icon: 2/3] wayland: Make DnD role inherit from MetaWaylandActorSurface



commit 740febfc3de5abf5f28a1481e4f631252bd9e4af
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Nov 30 20:35:15 2018 +0100

    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 b918e296e..bf33a8ff0 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
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]