[mutter/gbsneto/cleanup-x11-from-window-actor: 4/8] window-actor: Select X11 or Wayland actor based on client type



commit 0ae50b4c7be178893c24e2230bd01f6db680283a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Dec 21 18:38:53 2018 -0200

    window-actor: Select X11 or Wayland actor based on client type
    
    X11 clients now have a MetaWindowActorX11 on the surface. Next
    commits will move the X11-specific code to MetaWindowActorX11.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/368

 src/compositor/meta-window-actor.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index fab51ffb2..02508a88c 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -27,6 +27,8 @@
 #include "compositor/meta-surface-actor.h"
 #include "compositor/meta-texture-rectangle.h"
 #include "compositor/meta-window-actor-private.h"
+#include "compositor/meta-window-actor-wayland.h"
+#include "compositor/meta-window-actor-x11.h"
 #include "compositor/region-utils.h"
 #include "meta/display.h"
 #include "meta/meta-enum-types.h"
@@ -1484,8 +1486,20 @@ meta_window_actor_new (MetaWindow *window)
   MetaCompositor *compositor = display->compositor;
   MetaWindowActor        *self;
   ClutterActor           *window_group;
+  GType window_type;
 
-  self = g_object_new (META_TYPE_WINDOW_ACTOR,
+  switch (window->client_type)
+    {
+    case META_WINDOW_CLIENT_TYPE_X11:
+      window_type = META_TYPE_WINDOW_ACTOR_X11;
+      break;
+
+    case META_WINDOW_CLIENT_TYPE_WAYLAND:
+      window_type = META_TYPE_WINDOW_ACTOR_WAYLAND;
+      break;
+    }
+
+  self = g_object_new (window_type,
                        "meta-window", window,
                        NULL);
   priv = meta_window_actor_get_instance_private (self);


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