Commit c2653fbc authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

prefs: return FALSE if compositing_manager is not available

Move warning message about missing extensions required for
compositing from display.c to prefs. and display ths warning every
time user tries to enable compositing manager.

If required extension/extensions are missing return FALSE even
compositing-manager is enabled in preferences.
parent ab8c187d
......@@ -251,18 +251,6 @@ enable_compositor (MetaDisplay *display,
{
GSList *list;
if (!META_DISPLAY_HAS_COMPOSITE (display) ||
!META_DISPLAY_HAS_DAMAGE (display) ||
!META_DISPLAY_HAS_XFIXES (display) ||
!META_DISPLAY_HAS_RENDER (display))
{
meta_warning (_("Missing %s extension required for compositing"),
!META_DISPLAY_HAS_COMPOSITE (display) ? "composite" :
!META_DISPLAY_HAS_DAMAGE (display) ? "damage" :
!META_DISPLAY_HAS_XFIXES (display) ? "xfixes" : "render");
return;
}
if (!display->compositor)
display->compositor = meta_compositor_new (display);
......
......@@ -1839,6 +1839,32 @@ meta_prefs_get_window_binding (const char *name,
gboolean
meta_prefs_get_compositing_manager (void)
{
MetaDisplay *display;
static gboolean warned = FALSE;
display = meta_get_display ();
if (!compositing_manager)
warned = FALSE;
if (compositing_manager &&
(!META_DISPLAY_HAS_COMPOSITE (display) ||
!META_DISPLAY_HAS_DAMAGE (display) ||
!META_DISPLAY_HAS_XFIXES (display) ||
!META_DISPLAY_HAS_RENDER (display)))
{
if (!warned)
{
meta_warning (_("Missing %s extension required for compositing\n"),
!META_DISPLAY_HAS_COMPOSITE (display) ? "composite" :
!META_DISPLAY_HAS_DAMAGE (display) ? "damage" :
!META_DISPLAY_HAS_XFIXES (display) ? "xfixes" : "render");
warned = TRUE;
}
return FALSE;
}
return compositing_manager;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment