gdk/stage: Warn if CoglContext is not available

Instead of crashing inside Cogl later on.

https://bugzilla.gnome.org/show_bug.cgi?id=745229
This commit is contained in:
Emmanuele Bassi 2015-03-02 16:08:18 +00:00
parent 97ea9e973d
commit 3b98103b72

View File

@ -185,6 +185,12 @@ clutter_stage_gdk_realize (ClutterStageWindow *stage_window)
gboolean use_alpha; gboolean use_alpha;
gfloat width, height; gfloat width, height;
if (backend->cogl_context == NULL)
{
g_warning ("Missing Cogl context: was Clutter correctly initialized?");
return FALSE;
}
if (stage_gdk->foreign_window) if (stage_gdk->foreign_window)
{ {
width = gdk_window_get_width (stage_gdk->window); width = gdk_window_get_width (stage_gdk->window);