[mutter/wip/wayland] wayland: Show the MetaWindowActor when a wayland surface is created



commit 52433478ced0d5abd46bf1e51dfad356ab8673a4
Author: Neil Roberts <neil linux intel com>
Date:   Fri Jan 27 13:16:55 2012 +0000

    wayland: Show the MetaWindowActor when a wayland surface is created
    
    This adds a call to meta_window_actor_show when the MetaWindow for a
    Wayland surface is first created. This is necessary to get the plugin
    to receive an event that the window has appeared so that it will apply
    the effect.
    
    Under the Dawati Shell plugin this is also necessary to get it to
    notice that window has gone fullscreen because it only connects to the
    notify::fullscreen signal in response to the map event.

 src/wayland/meta-wayland.c |   53 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 44 insertions(+), 9 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 840d967..243e0c9 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -704,20 +704,13 @@ shell_surface_resize (struct wl_client *client,
 }
 
 static void
-shell_surface_set_toplevel (struct wl_client *client,
-                            struct wl_resource *resource)
+ensure_surface_window (MetaWaylandSurface *surface)
 {
-  MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
-  MetaWaylandShellSurface *shell_surface = resource->data;
-  MetaWaylandSurface *surface = shell_surface->surface;
   MetaDisplay *display = meta_get_display ();
 
-  /* NB: Surfaces from xwayland become managed based on X events. */
-  if (client == compositor->xwayland_client)
-    return;
-
   if (!surface->window)
     {
+      ClutterActor *window_actor;
       int width, height;
 
       if (surface->buffer && surface->buffer->wayland_buffer)
@@ -740,6 +733,11 @@ shell_surface_set_toplevel (struct wl_client *client,
        * surface... */
       g_assert (surface->actor);
 
+      window_actor =
+        CLUTTER_ACTOR (meta_window_get_compositor_private (surface->window));
+      meta_window_actor_show (META_WINDOW_ACTOR (window_actor),
+                              META_COMP_EFFECT_CREATE);
+
       /* If the MetaWindow becomes unmanaged (surface->actor will be freed in
        * this case) we need to make sure to clear our ->actor and ->window
        * pointers. */
@@ -750,6 +748,23 @@ shell_surface_set_toplevel (struct wl_client *client,
 }
 
 static void
+shell_surface_set_toplevel (struct wl_client *client,
+                            struct wl_resource *resource)
+{
+  MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
+  MetaWaylandShellSurface *shell_surface = resource->data;
+  MetaWaylandSurface *surface = shell_surface->surface;
+
+  /* NB: Surfaces from xwayland become managed based on X events. */
+  if (client == compositor->xwayland_client)
+    return;
+
+  ensure_surface_window (surface);
+
+  meta_window_unmake_fullscreen (surface->window);
+}
+
+static void
 shell_surface_set_transient (struct wl_client *client,
                              struct wl_resource *resource,
                              struct wl_resource *parent_resource,
@@ -757,12 +772,32 @@ shell_surface_set_transient (struct wl_client *client,
                              int y,
                              guint32 flags)
 {
+  MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
+  MetaWaylandShellSurface *shell_surface = resource->data;
+  MetaWaylandSurface *surface = shell_surface->surface;
+
+  /* NB: Surfaces from xwayland become managed based on X events. */
+  if (client == compositor->xwayland_client)
+    return;
+
+  ensure_surface_window (surface);
 }
 
 static void
 shell_surface_set_fullscreen (struct wl_client *client,
                               struct wl_resource *resource)
 {
+  MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
+  MetaWaylandShellSurface *shell_surface = resource->data;
+  MetaWaylandSurface *surface = shell_surface->surface;
+
+  /* NB: Surfaces from xwayland become managed based on X events. */
+  if (client == compositor->xwayland_client)
+    return;
+
+  ensure_surface_window (surface);
+
+  meta_window_make_fullscreen (surface->window);
 }
 
 static const struct wl_shell_surface_interface meta_wayland_shell_surface_interface =



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