[metacity] display: add META_COMPOSITOR environment variable



commit 2c193fe9368a4602f1f58601119fd63aa6a2eb7d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Mar 9 23:10:33 2017 +0200

    display: add META_COMPOSITOR environment variable

 src/core/display.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index fa8b928..cb2cdd0 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -248,15 +248,29 @@ static void
 update_compositor (MetaDisplay *display,
                    gboolean     composite_windows)
 {
+  const gchar *compositor;
   MetaCompositorType type;
 
   if (display->compositor != NULL)
     g_object_unref (display->compositor);
 
-  if (meta_prefs_get_compositing_manager ())
-    type = META_COMPOSITOR_TYPE_XRENDER;
+  compositor = g_getenv ("META_COMPOSITOR");
+  if (compositor != NULL)
+    {
+      if (g_strcmp0 (compositor, "vulkan") == 0)
+        type = META_COMPOSITOR_TYPE_VULKAN;
+      else if (g_strcmp0 (compositor, "xrender") == 0)
+        type = META_COMPOSITOR_TYPE_XRENDER;
+      else
+        type = META_COMPOSITOR_TYPE_NONE;
+    }
   else
-    type = META_COMPOSITOR_TYPE_NONE;
+    {
+      if (meta_prefs_get_compositing_manager ())
+        type = META_COMPOSITOR_TYPE_XRENDER;
+      else
+        type = META_COMPOSITOR_TYPE_NONE;
+    }
 
   display->compositor = meta_compositor_new (type, display);
 


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