Merge pull request #2379 from Perlovka/menubar/utils.lua
menubar.utils: Allow to add programs with OnlyShowIn option being set
This commit is contained in:
commit
1e4ef0bca0
|
@ -297,17 +297,19 @@ function utils.parse_desktop_file(file)
|
||||||
-- Only check these values is NoDisplay is true (or non-existent)
|
-- Only check these values is NoDisplay is true (or non-existent)
|
||||||
|
|
||||||
-- Only show the program if there is no OnlyShowIn attribute
|
-- Only show the program if there is no OnlyShowIn attribute
|
||||||
-- or if it contains wm_name
|
-- or if it contains wm_name or wm_name is empty
|
||||||
if program.OnlyShowIn then
|
if utils.wm_name ~= "" then
|
||||||
program.show = false -- Assume false until found
|
if program.OnlyShowIn then
|
||||||
for _, wm in ipairs(program.OnlyShowIn) do
|
program.show = false -- Assume false until found
|
||||||
if wm == utils.wm_name then
|
for _, wm in ipairs(program.OnlyShowIn) do
|
||||||
program.show = true
|
if wm == utils.wm_name then
|
||||||
break
|
program.show = true
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
program.show = true
|
||||||
end
|
end
|
||||||
else
|
|
||||||
program.show = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Only need to check NotShowIn if the program is being shown
|
-- Only need to check NotShowIn if the program is being shown
|
||||||
|
|
Loading…
Reference in New Issue