diff --git a/ChangeLog b/ChangeLog index 1447aa34d..f80cc0b20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-04-03 Emmanuele Bassi + + * clutter/glx/clutter-backend-glx.c: + (clutter_backend_glx_get_features): Assert if we don't have a + GL context here or if it's not matched to a drawable. Asserting + might seem too drastic, but if we don't have a valid GL context + here then Clutter will segfault anyway, and I'll take an assert() + over a hard to read, deep in GLX guts backtrace any day (and + twice on a monday). + + * clutter/x11/clutter-backend-x11.c: + (clutter_backend_x11_get_features): No need for a variable here. + 2008-04-01 Matthew Allum * clutter/clutter-backend.c: diff --git a/clutter/glx/clutter-backend-glx.c b/clutter/glx/clutter-backend-glx.c index de6eaad69..9d17252ef 100644 --- a/clutter/glx/clutter-backend-glx.c +++ b/clutter/glx/clutter-backend-glx.c @@ -216,7 +216,11 @@ clutter_backend_glx_get_features (ClutterBackend *backend) const gchar *glx_extensions = NULL; ClutterFeatureFlags flags = CLUTTER_FEATURE_STAGE_MULTIPLE; - /* FIXME: we really need to check if gl context is set */ + /* this will make sure that the GL context exists and its + * bound to a drawable + */ + g_assert (backend_glx->gl_context != None); + g_assert (glXGetCurrentDrawable () != None); CLUTTER_NOTE (BACKEND, "Checking features\n" "GL_VENDOR: %s\n" diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index 73e27832e..58c334ff3 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -288,13 +288,7 @@ clutter_backend_x11_constructor (GType gtype, ClutterFeatureFlags clutter_backend_x11_get_features (ClutterBackend *backend) { - ClutterFeatureFlags flags = 0; - - /* FIXME: we really need to check if gl context is set */ - - flags = CLUTTER_FEATURE_STAGE_USER_RESIZE|CLUTTER_FEATURE_STAGE_CURSOR; - - return flags; + return CLUTTER_FEATURE_STAGE_USER_RESIZE | CLUTTER_FEATURE_STAGE_CURSOR; } static void