[gnome-shell/wip/hadess/always-launch-discrete-gpu: 3/4] appDisplay: Respect X-KDE-RunOnDiscreteGpu appInfo property



commit 366b06716d59e45158b4ecf9c2f7d987fcbda7e1
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 21 12:55:38 2019 +0200

    appDisplay: Respect X-KDE-RunOnDiscreteGpu appInfo property
    
    When X-KDE-RunOnDiscreteGpu is set in the application's .desktop file,
    launch the application on the discrete GPU if available, and offer
    to launch on the discrete GPU manually otherwise.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1804

 js/ui/appDisplay.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index d79c9b54b6..a2c2e131bb 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -2513,12 +2513,15 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
                 this._appendSeparator();
             }
 
+            let wantsDiscreteGpu = appInfo.get_boolean("PreferRunOnDiscreteGPU") ||
+                appInfo.get_boolean("X-KDE-RunOnDiscreteGpu");
             if (discreteGpuAvailable &&
+                !wantsDiscreteGpu &&
                 this._source.app.state == Shell.AppState.STOPPED) {
                 this._onDiscreteGpuMenuItem = this._appendMenuItem(_("Launch using Dedicated Graphics 
Card"));
                 this._onDiscreteGpuMenuItem.connect('activate', () => {
                     this._source.animateLaunch();
-                    this._source.app.launch(0, -1, true);
+                    this._source.app.launch(0, -1, Shell.AppGpuSelection.DISCRETE);
                     this.emit('activate-window', null);
                 });
             }


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