From 366b06716d59e45158b4ecf9c2f7d987fcbda7e1 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 21 Oct 2019 12:55:38 +0200 Subject: [PATCH] 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 d79c9b54b..a2c2e131b 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); }); }