diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index b8fe294a..0aaec1f5 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -546,13 +546,15 @@ if capi.dbus then -- 1 -> width, 2 -> height, 3 -> rowstride, 4 -> has alpha -- 5 -> bits per sample, 6 -> channels, 7 -> data - local imgdata + local imgdata = "" -- If has alpha (ARGB32) if hints.icon_data[6] == 4 then - imgdata = hints.icon_data[7] + for i = 1, #hints.icon_data[7], 4 do + imgdata = imgdata .. hints.icon_data[7]:sub(i, i + 2):reverse() + imgdata = imgdata .. hints.icon_data[7]:sub(i + 3, i + 3) + end -- If has not alpha (RGB24) elseif hints.icon_data[6] == 3 then - imgdata = "" for i = 1, #hints.icon_data[7], 3 do imgdata = imgdata .. hints.icon_data[7]:sub(i , i + 2):reverse() imgdata = imgdata .. string.format("%c", 255) -- alpha is 255