[clutter] gdk/stage: Warn if CoglContext is not available



commit 3b98103b72b864d590d644a8ee237f63ffe373bd
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Mar 2 16:08:18 2015 +0000

    gdk/stage: Warn if CoglContext is not available
    
    Instead of crashing inside Cogl later on.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745229

 clutter/gdk/clutter-stage-gdk.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c
index 94b49bb..e855a98 100644
--- a/clutter/gdk/clutter-stage-gdk.c
+++ b/clutter/gdk/clutter-stage-gdk.c
@@ -185,6 +185,12 @@ clutter_stage_gdk_realize (ClutterStageWindow *stage_window)
   gboolean use_alpha;
   gfloat   width, height;
 
+  if (backend->cogl_context == NULL)
+    {
+      g_warning ("Missing Cogl context: was Clutter correctly initialized?");
+      return FALSE;
+    }
+
   if (stage_gdk->foreign_window)
     {
       width = gdk_window_get_width (stage_gdk->window);


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