Allow configuring script's screen edges from the KCM
ClosedPublic

Authored by davidedmundson on Oct 7 2016, 12:09 AM.

Details

Summary

Modify the kwinscreenedges KCM to also list scripts which support screen
edge activation and read/write the appropriate value in the script's
config.

In order to only show relevant scripts an additional .desktop metadata
field is added.

Test Plan

Opened KCM set a hot corner for minimize all.
Tested it
unset it, and set on another corner
Tested again

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson retitled this revision from to Allow configuring script's screen edges from the KCM.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptOct 7 2016, 12:09 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
graesslin added inline comments.
kcmkwin/kwinscreenedges/main.cpp
96–97

nitpick

211

Why are you querying KService? Scripts are packages and at least KWin internally they are queried using:

KPackage::PackageLoader::self()->listPackages(QStringLiteral("KWin/Script"), scriptFolder);
215

please don't add any new foreach any more. It might get deprecated

331

same here

davidedmundson added inline comments.Oct 7 2016, 10:09 AM
kcmkwin/kwinscreenedges/main.cpp
211

it's copy paste from kcm_kwinscripts

If you are doing that in kwin you have a bug as you're ignoring the KWin-Exclude-Listing flag and potentially loading things that you can't configure.

foreach -> for

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptOct 7 2016, 10:10 AM
graesslin added inline comments.Oct 7 2016, 10:48 AM
kcmkwin/kwinscreenedges/main.cpp
211

If you are doing that in kwin you have a bug as you're ignoring the KWin-Exclude-Listing flag and potentially loading things that you can't configure.

KWin-Exclude-Listing is for the KCM to not show them IIRC, but not for KWin. Anyway the KCMs need to be ported to KPackage, it's just legacy, let's not add more porting work to new code. I would appreciate if that could be changed to packages here.

Use KPackage for loading

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptOct 7 2016, 11:09 AM
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptOct 7 2016, 11:38 AM
graesslin accepted this revision.Oct 7 2016, 12:58 PM
graesslin added a reviewer: graesslin.
This revision is now accepted and ready to land.Oct 7 2016, 12:58 PM
This revision was automatically updated to reflect the committed changes.