[mutter] surface: Don't calculate geometry for buffer-less subsurfaces



commit e822e51752bedf4f7d297f340b76e5cf82eecaaa
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Aug 26 16:12:38 2014 +0200

    surface: Don't calculate geometry for buffer-less subsurfaces
    
    A wl_surface may have a wl_subsurface interface, but no buffers attached
    yet, even though the geometry calculation code for surfaces/subsurfaces
    assumes everything has already a buffer.
    
    Just skip subsurfaces that don't have a buffer, those can't be set
    a geometry yet, and right now it's crashing accessing the texture from
    the NULL surface->buffer.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735452

 src/wayland/meta-wayland-surface.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index bc66373..1dade05 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -187,6 +187,9 @@ calculate_surface_window_geometry (MetaWaylandSurface *surface,
   if (!CLUTTER_ACTOR_IS_VISIBLE (surface_actor))
     return;
 
+  if (!surface->buffer)
+    return;
+
   /* XXX: Is there a better way to do this using Clutter APIs? */
   clutter_actor_get_position (surface_actor, &x, &y);
 


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