[gnome-shell/wip/hadess/always-launch-discrete-gpu: 3/6] shell-app: Launch on integrated GPU when requested



commit c56daf88cdd625e416028d3a66a86ad9fd32236d
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 21 12:12:39 2019 +0200

    shell-app: Launch on integrated GPU when requested
    
    Always set the DRI_PRIME environment variable when launch apps, so that
    applications are force launched on the integrated GPU by default.
    
    See: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1804

 src/shell-app.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 33d5ec3a7a..63f3edeabc 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -1289,8 +1289,7 @@ shell_app_launch (ShellApp     *app,
 
   global = shell_global_get ();
   context = shell_global_create_app_launch_context (global, timestamp, workspace);
-  if (discrete_gpu)
-    g_app_launch_context_setenv (context, "DRI_PRIME", "1");
+  g_app_launch_context_setenv (context, "DRI_PRIME", discrete_gpu ? "1" : "0");
 
   /* Set LEAVE_DESCRIPTORS_OPEN in order to use an optimized gspawn
    * codepath. The shell's open file descriptors should be marked CLOEXEC


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