SUMMARY If a desktop file doesn't already have PrefersNonDefaultGPU, the dialog sets the legacy X-KDE-RunOnDiscreteGpu key due to an overlooked conditional order in the name of backwards compatibility. STEPS TO REPRODUCE 0. Use 2 GPUs/Hybrid laptop 1. Find an app that doesn't already have PrefersNonDefaultGPU key (almost all regular apps) 2. Mark "Use discrete GPU" in advanced launch settings 3. It writes X-KDE-RunOnDiscreteGpu instead 4. Find an app that does have PrefersNonDefaultGPU key (i.e. switcheroo-control-test-app) 5. (Un)mark "Use discrete GPU" in advanced settings 6. Correctly (un)sets the key OBSERVED RESULT (Un)sets PrefersNonDefaultGPU if the key already exists, but writes X-KDE-RunOnDiscreteGpu on new entries. KIO checks for PrefersNonDefaultGPU and falls back to X-KDE-RunOnDiscreteGpu but in the wrong conditional order Kservice part is correct (but backwards compatibility part can still be dropped) EXPECTED RESULT (Un)set X-KDE-RunOnDiscreteGpu if the key already exists, but write PrefersNonDefaultGPU for new entries. OR Only take PrefersNonDefaultGPU into account since the legacy one should be deprecated since 2020 and Plasma 6 can break backwards compatibility. SOFTWARE/OS VERSIONS KDE Plasma Version: Broken since bundled, Plasma 5.23 KDE Frameworks Version: Broken since added, KF 5.86. ADDITIONAL INFORMATION Seems to be added with https://invent.kde.org/frameworks/kio/-/commit/85c5815e10a3b448583817de98486d14ebcba3fc The current file is in https://invent.kde.org/frameworks/kio/-/blob/master/src/widgets/kpropertiesdialogbuiltin_p.cpp?ref_type=heads#L2829 (moved since the mentioned commit) Should either drop X-KDE-RunOnDiscreteGpu entirely, or swap the two conditionals (and backport to 5.27 as well?) Or drop in 5.27 as well since apps can't set X-KDE-RunOnDiscreteGpu as they should follow the upstream spec anyway. It's tiny, so can I take it as a good first fix/contribution if you can guide the decision? Thanks xP
Sounds good, feel free to fix this! Dropping X-KDE-RunOnDiscreteGpu makes sense to me since it's deprecated and we're in KF6 territory now. Be aware of parallel work ongoing in https://invent.kde.org/frameworks/kio/-/merge_requests/1556.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1562
Thanks, I checked 1556 and this is way above that to interfere anything, just desktop key checking hehe Just the write action condition can simply be reversed (instead of being dropped) for 5.27, but either way that needs approval and I don't know how to do stuff for LTS yet..
Git commit 3fc80769b60d3590d8ece6955852080584accbaf by Harald Sitter, on behalf of Berk Elyesa Yıldırım. Committed on 15/03/2024 at 13:43. Pushed by sitter into branch 'master'. Drop legacy keys for m_runOnDiscreteGpuBool We shouldn't write X-KDE-RunOnDiscreteGpu anymore, Prefer PrefersNonDefaultGPU following the upstream spec. It was already half-broken anyway. M +1 -6 src/widgets/kpropertiesdialogbuiltin_p.cpp https://invent.kde.org/frameworks/kio/-/commit/3fc80769b60d3590d8ece6955852080584accbaf