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:
Daniel Hahler 2019-01-03 13:47:26 +01:00 committed by GitHub
commit 1e4ef0bca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -297,7 +297,8 @@ 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 utils.wm_name ~= "" then
if program.OnlyShowIn then if program.OnlyShowIn then
program.show = false -- Assume false until found program.show = false -- Assume false until found
for _, wm in ipairs(program.OnlyShowIn) do for _, wm in ipairs(program.OnlyShowIn) do
@ -309,6 +310,7 @@ function utils.parse_desktop_file(file)
else else
program.show = true program.show = true
end end
end
-- Only need to check NotShowIn if the program is being shown -- Only need to check NotShowIn if the program is being shown
if program.show and program.NotShowIn then if program.show and program.NotShowIn then