[mutter/wip/wayland-display: 44/93] wayland: fix a #warning



commit a420b37ebb98dec2900671b1649eff95fcdd1c48
Author: Giovanni Campagna <gcampagn redhat com>
Date:   Mon Aug 12 10:16:20 2013 +0200

    wayland: fix a #warning
    
    Remove window_surfaces, as the FIXME asks for. We don't need it
    because we can obtain the surface from the MetaWindow, and
    follow the wayland compositor path for both types of clients.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705818

 src/compositor/meta-shaped-texture.c |   10 +---------
 src/compositor/meta-window-actor.c   |    6 +++---
 src/wayland/meta-wayland-private.h   |    3 ---
 src/wayland/meta-wayland.c           |   12 ------------
 4 files changed, 4 insertions(+), 27 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index cc09575..f0279f9 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -503,15 +503,7 @@ meta_shaped_texture_get_wayland_surface (MetaShapedTexture *stex)
 ClutterActor *
 meta_shaped_texture_new_with_xwindow (Window xwindow)
 {
-#ifdef HAVE_WAYLAND
-  if (meta_is_wayland_compositor ())
-    {
-      MetaWaylandSurface *surface = meta_wayland_lookup_surface_for_xid (xwindow);
-      return meta_shaped_texture_new_with_wayland_surface (surface);
-    }
-  else
-#endif
-    return g_object_new (META_TYPE_SHAPED_TEXTURE, NULL);
+  return g_object_new (META_TYPE_SHAPED_TEXTURE, NULL);
 }
 
 void
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index c905fbd..d738947 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -371,12 +371,12 @@ meta_window_actor_constructed (GObject *object)
 
   if (!priv->actor)
     {
-      if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
-        priv->actor = meta_shaped_texture_new_with_xwindow (xwindow);
 #ifdef HAVE_WAYLAND
-      else
+      if (meta_is_wayland_compositor ())
         priv->actor = meta_shaped_texture_new_with_wayland_surface (window->surface);
+      else
 #endif
+        priv->actor = meta_shaped_texture_new_with_xwindow (xwindow);
 
       clutter_actor_add_child (CLUTTER_ACTOR (self), priv->actor);
 
diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h
index c33f7f9..b4ba57d 100644
--- a/src/wayland/meta-wayland-private.h
+++ b/src/wayland/meta-wayland-private.h
@@ -164,7 +164,6 @@ struct _MetaWaylandCompositor
   pid_t xwayland_pid;
   struct wl_client *xwayland_client;
   struct wl_resource *xserver_resource;
-  GHashTable *window_surfaces;
 
   MetaWaylandSeat *seat;
 
@@ -352,8 +351,6 @@ MetaWaylandCompositor  *meta_wayland_compositor_get_default     (void);
 
 void                    meta_wayland_handle_sig_child           (void);
 
-MetaWaylandSurface     *meta_wayland_lookup_surface_for_xid     (guint32 xid);
-
 void                    meta_wayland_compositor_repick          (MetaWaylandCompositor *compositor);
 
 void                    meta_wayland_compositor_set_input_focus (MetaWaylandCompositor *compositor,
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index b354201..cc35b13 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -1153,8 +1153,6 @@ xserver_set_window_id (struct wl_client *client,
 
   surface->xid = xid;
 
-  g_hash_table_insert (compositor->window_surfaces, &xid, surface);
-
   window  = meta_display_lookup_x_window (display, xid);
   if (window)
     {
@@ -1181,13 +1179,6 @@ xserver_set_window_id (struct wl_client *client,
         meta_wayland_compositor_set_input_focus (compositor, window);
 
     }
-#warning "FIXME: Handle surface destroy and remove window_surfaces mapping"
-}
-
-MetaWaylandSurface *
-meta_wayland_lookup_surface_for_xid (guint32 xid)
-{
-  return g_hash_table_lookup (_meta_wayland_compositor.window_surfaces, &xid);
 }
 
 static const struct xserver_interface xserver_implementation = {
@@ -1558,9 +1549,6 @@ meta_wayland_init (void)
                    &xserver_interface, 1,
                    compositor, bind_xserver);
 
-  /* We need a mapping from xids to wayland surfaces... */
-  compositor->window_surfaces = g_hash_table_new (g_int_hash, g_int_equal);
-
   /* XXX: It's important that we only try and start xwayland after we
    * have initialized EGL because EGL implements the "wl_drm"
    * interface which xwayland requires to determine what drm device


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