Fix window icon not working on X11 with 64bits

Apparently on X11 the maximum icon size is 128x128. 256x256 is too
large for the X11 protocol because the X server unserializes the icons
using "unsigned long" which is 64 bits on Linux. So we have to use
64bits per pixel instead of 32, with 32bits padded to 0.

While there I also got rid of the kitty.rgba file replacing it with a
128x128 PNG file.

Fixes #3260
This commit is contained in:
Kovid Goyal
2021-01-25 20:51:34 +05:30
parent 6e73d3fac8
commit 5a2f2767ad
10 changed files with 28 additions and 19 deletions

BIN
logo/kitty-128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

View File

@@ -29,7 +29,6 @@ def render(output, sz=256):
def main():
render(abspath('kitty.png'))
run('convert', abspath('kitty.png'), '-depth', '8', abspath('kitty.rgba'))
iconset = abspath('kitty.iconset')
if os.path.exists(iconset):
shutil.rmtree(iconset)
@@ -39,6 +38,8 @@ def main():
iname = os.path.join(iconset, 'icon_{0}x{0}.png'.format(sz))
iname2x = 'icon_{0}x{0}@2x.png'.format(sz // 2)
render(iname, sz)
if sz == 128:
shutil.copyfile(iname, abspath('kitty-128.png'))
if sz > 16 and sz != 128:
shutil.copy2(iname, iname2x)
if sz in (64, 1024):