Application launched by shortcut do not respect command argument quotes as expected. STEPS TO REPRODUCE 1. Start kmenuedit 2. Copy "Falkon" entry to "Falkon Creative" 3. Change command to 'falkon --no-remote --wmclass="falkon creative" --profile creative %u' 4. Assign keyboard shortcut to launch entry "Falkon Creative" 5. Launch Application with shortcut 6. Open window rule settings, add new rule, detect Window Properties from previously shortcut-launched "Falkon Creative" entry 7. Observe window class being set to ' "falkon' instead of ' "falkon creative"' set by --wmclass parameter 8. Close "Falkon Creative", restart it with Krunner 9. Recognize the correct window class "falkon creative" being set OBSERVED RESULT Application window class set by command argument --wmclass="class name" is obviously not respecting argument quotes if application is started via keyboard shortcut. EXPECTED RESULT Handle Krunner launches and Keyboard shortcut launches in the same way
It seems like this works fine once the kglobalaccel5 process is restarted
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/31
I just tried to restart kglobalaccel5 but still observe the same behavior. It seems that --wmclass="class name" is parsed as --wmclass="class or something
That seems to be an additional issue unrelated to the one I am describing. Looking at the code I see why it is failing, it splits the string on spaces, ignoring the shell syntax: https://invent.kde.org/frameworks/kglobalaccel/-/blob/master/src/runtime/kserviceactioncomponent.cpp#L41
Oh I see, maybe another "splitter" is used in krunner? Something like QCommandLineParser ?
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/32
well KShell::splitArgs perfect! not even based on QCommandLineParser Thanks!
Git commit 8a213c78cf1acfef28f7b7ba2bb5c4414100dc19 by Nicolas Fella. Committed on 31/10/2021 at 20:24. Pushed by nicolasfella into branch 'master'. Properly split exec line args Splitting at space breaks when using spaces escaped by shell syntax. Consider the following exec line: app --arg="foo bar" Previously this would be split into: (app, --arg="foo, bar) Now it is correclty split into: (app, --arg="foo bar") M +3 -1 src/runtime/kserviceactioncomponent.cpp https://invent.kde.org/frameworks/kglobalaccel/commit/8a213c78cf1acfef28f7b7ba2bb5c4414100dc19
Anything left to do here, or is this fully fixed now?
unfortunately I havent compiled and tested the solution yet, but the code snipped looks very promising!
well, https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/31/ isn't merged yet, other than that we should be good