Fix silent launch failure for apps whose desktop id ends in .desktop (Telegram) (#6418)
* Launch apps by their full desktop file name gtk-launch only appends the .desktop suffix when the argument doesn't already end with it. Apps whose desktop id itself ends in .desktop -- notably Telegram (org.telegram.desktop.desktop) -- were therefore looked up as a nonexistent file and silently failed to launch from the menu, while every other app worked. Passing the full file name to gtk-launch resolves the entry unambiguously for both naming styles. * Clarify launch comment wording
This commit is contained in:
@@ -78,7 +78,10 @@ Item {
|
|||||||
var id = String(desktopId || "")
|
var id = String(desktopId || "")
|
||||||
if (!id) return
|
if (!id) return
|
||||||
root.beginLaunchFeedback(name)
|
root.beginLaunchFeedback(name)
|
||||||
Util.execDetached("gtk-launch " + Util.shellQuote(id))
|
// Pass the file name with its extension: gtk-launch only appends ".desktop"
|
||||||
|
// when the argument doesn't already end with it, so ids that themselves end
|
||||||
|
// in ".desktop" (e.g. org.telegram.desktop) would otherwise never resolve.
|
||||||
|
Util.execDetached("gtk-launch " + Util.shellQuote(id + ".desktop"))
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(desktopId, name) {
|
function remove(desktopId, name) {
|
||||||
|
|||||||
@@ -104,6 +104,11 @@ assert(
|
|||||||
'app library runs desktop entry launch through the shell'
|
'app library runs desktop entry launch through the shell'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert(
|
||||||
|
appLibraryQml.includes('Util.shellQuote(id + ".desktop")'),
|
||||||
|
'app library launches by full file name so ids ending in .desktop (org.telegram.desktop) resolve'
|
||||||
|
)
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
/function iconIndexScanCommand\(\)[\s\S]*-path "\*\/apps\/\*" -o -path "\*\/devices\/\*"/.test(appLibraryQml),
|
/function iconIndexScanCommand\(\)[\s\S]*-path "\*\/apps\/\*" -o -path "\*\/devices\/\*"/.test(appLibraryQml),
|
||||||
'app library fallback icon index includes device icons'
|
'app library fallback icon index includes device icons'
|
||||||
|
|||||||
Reference in New Issue
Block a user