[mutter] stage: Refine our assertions for overlays in MetaStage



commit b879af46b3b6c78c4cac026108227474e9838ff3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Aug 21 18:03:03 2014 -0400

    stage: Refine our assertions for overlays in MetaStage
    
    We indeed call this function if we're not an X11 compositor, but in this
    case we're simply calling it to say that we have no cursor overlay. Make
    sure not to assert fail in this case.

 src/backends/meta-stage.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index 7f50a20..e304441 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -88,11 +88,11 @@ meta_overlay_set (MetaOverlay   *overlay,
 static void
 meta_overlay_paint (MetaOverlay *overlay)
 {
-  g_assert (meta_is_wayland_compositor ());
-
   if (!overlay->enabled)
     return;
 
+  g_assert (meta_is_wayland_compositor ());
+
   cogl_framebuffer_draw_rectangle (cogl_get_draw_framebuffer (),
                                    overlay->pipeline,
                                    overlay->current_rect.x,
@@ -190,7 +190,7 @@ meta_stage_set_cursor (MetaStage     *stage,
 {
   MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
 
-  g_assert (meta_is_wayland_compositor ());
+  g_assert (meta_is_wayland_compositor () || texture == NULL);
 
   meta_overlay_set (&priv->cursor_overlay, texture, rect);
   queue_redraw_for_overlay (stage, &priv->cursor_overlay);


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