[mutter/wip/wayland] window-actor/wayland: Update bounds on texture change



commit 240a3a446b194b56fd810b7c93e63a87270c2abb
Author: Robert Bragg <robert linux intel com>
Date:   Fri Jan 13 13:36:39 2012 +0000

    window-actor/wayland: Update bounds on texture change
    
    This fixes resizing of x windows when running as a wayland compositor by
    ensuring we update the windows bounding region and borders whenever we
    are notified of a new cogl-texture for the internal
    ClutterWaylandSurface actor.

 src/compositor/meta-window-actor.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 66bbb29..426341d 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -172,6 +172,10 @@ static void meta_window_actor_clear_shape_region    (MetaWindowActor *self);
 static void meta_window_actor_clear_bounding_region (MetaWindowActor *self);
 static void meta_window_actor_clear_shadow_clip     (MetaWindowActor *self);
 
+static void meta_window_actor_update_bounding_region_and_borders (MetaWindowActor *self,
+                                                                  int              width,
+                                                                  int              height);
+
 G_DEFINE_TYPE (MetaWindowActor, meta_window_actor, CLUTTER_TYPE_GROUP);
 
 static void
@@ -330,6 +334,21 @@ window_appears_focused_notify (MetaWindow *mw,
   clutter_actor_queue_redraw (CLUTTER_ACTOR (data));
 }
 
+#ifdef HAVE_WAYLAND
+static void
+cogl_texture_notify (ClutterWaylandSurface *surface,
+                     GParamSpec             *arg1,
+                     MetaWindowActor        *self)
+{
+  CoglHandle tex = clutter_wayland_surface_get_cogl_texture (surface);
+  int width = cogl_texture_get_width (tex);
+  int height = cogl_texture_get_height (tex);
+  meta_window_actor_update_bounding_region_and_borders (self,
+                                                        width,
+                                                        height);
+}
+#endif
+
 static void
 meta_window_actor_constructed (GObject *object)
 {
@@ -371,6 +390,10 @@ meta_window_actor_constructed (GObject *object)
                         G_CALLBACK (window_decorated_notify), self);
       g_signal_connect (window, "notify::appears-focused",
                         G_CALLBACK (window_appears_focused_notify), self);
+#ifdef HAVE_WAYLAND
+      g_signal_connect (priv->actor, "notify::cogl-texture",
+                        G_CALLBACK (cogl_texture_notify), self);
+#endif
     }
   else
     {
@@ -1659,7 +1682,6 @@ meta_window_actor_clear_shadow_clip (MetaWindowActor *self)
     }
 }
 
-#ifndef HAVE_WAYLAND
 static void
 meta_window_actor_update_bounding_region_and_borders (MetaWindowActor *self,
                                                       int              width,
@@ -1716,7 +1738,6 @@ meta_window_actor_update_bounding_region_and_borders (MetaWindowActor *self,
 
   g_signal_emit (self, signals[SIZE_CHANGED], 0);
 }
-#endif
 
 static void
 meta_window_actor_update_shape_region (MetaWindowActor *self,



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