mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
Emit a critical warning if features are not initialized
If you forgot to call clutter_init() then you currently end up with a warning saying that the stage cannot be initialized because the backend does not support multiple stages. Clearly not useful. We can catch some of the missing initialization in the features API, since we will likely end up asking for a feature at some point.
This commit is contained in:
parent
54504b7ac4
commit
d2bb57c3b2
@ -131,7 +131,10 @@ gboolean
|
||||
clutter_feature_available (ClutterFeatureFlags feature)
|
||||
{
|
||||
if (G_UNLIKELY (!__features))
|
||||
{
|
||||
g_critical ("Unable to check features. Have you initialized Clutter?");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return (__features->flags & feature);
|
||||
}
|
||||
@ -148,6 +151,12 @@ clutter_feature_available (ClutterFeatureFlags feature)
|
||||
ClutterFeatureFlags
|
||||
clutter_feature_get_all (void)
|
||||
{
|
||||
if (G_UNLIKELY (!__features))
|
||||
{
|
||||
g_critical ("Unable to check features. Have you initialized Clutter?");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return __features->flags;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user