xpra icon
Bug tracker and wiki

Opened 2 weeks ago

Closed 2 weeks ago

#2257 closed defect (duplicate)

BGRA icons garbled

Reported by: Vincent Huisman Owned by: Antoine Martin
Priority: minor Milestone: 3.0
Component: server Version: 2.5.x
Keywords: Cc:


I have had issues with the window icon from day one of using Xpra (about two weeks ago), it would always look garbled. At first I thought it could not extract window icons from KDE programs (e.g. xterm worked fine) and that it just took a screenshot and scaled that, but that didn't look logical with different programs. I fired up some debugging stuff, and the logs showed that it did, in fact, find a lot of icons.

Log excerpt for konsole:

2019-04-06 06:00:01,546 _NET_WM_ICON_NAME=
2019-04-06 06:00:01,547 _NET_WM_ICON changed on 0x600007, re-reading
2019-04-06 06:00:01,587 WindowIconSource(['premult_argb32', 'default', 'png'], {'default.icons': (), 'max_size': (128, 128), 'greedy': True, 'size': (64, 64)}) has_png=True, has_premult=True
2019-04-06 06:00:01,588 client icon settings: size=(64, 64), max_size=(128, 128)
2019-04-06 06:00:01,595 send_window_icon window WindowModel(0x600007) found 7 icons
2019-04-06 06:00:01,596 send_window_icon() window=WindowModel(0x600007), wid=1, compression scheduled in 50ms for batch delay=-1
2019-04-06 06:00:01,648 compress_and_send_window_icon() 64x64 in BGRA format, 16384 bytes
2019-04-06 06:00:01,648 compress_and_send_window_icon: 64x64 (max-size=(128, 128), standard-size=(64, 64)), sending as png=True, pixel_format=BGRA
2019-04-06 06:00:01,648  must convert=True, must scale=False
2019-04-06 06:00:01,650 server window icon saved to server-window-1-icon-433769.png
2019-04-06 06:00:01,651 queuing window icon update: ('window-icon', 1, 64, 64, 'png', Compressed(png: 2395 bytes))

I saved them and found a rather interesting result, it seems that the application icon is repeated 4 times in the top quarter of the resulting image with little to no color (or high transparency), the remainder filled with some garbage. After a lot of digging I converged on a part I ignored at first, but which had to be the problem. The key here is that the icon is in BGRA format. This causes a premultiplication and that seems to screw it up. If I comment out line 190 of windowicon_source.py, I get the proper icons in all of the applications I'm using:
#pixel_data = premultiply_argb(pixel_data)

I have little to no knowledge of the inner workings of Xpra so I assume this isn't a catch-all solution.

The server is running Kubuntu 18.10 with Xpra 2.5-r22135-1, as a guest in VMWare.

xpra start --daemon=no --bind-tcp= --mdns=yes --pulseaudio=no --speaker=disabled --microphone=disabled --printing=no --tcp-auth=password,value=xxx
start-env = XDG_CONFIG_DIRS=/etc/xdg/xdg-plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
start-env = XDG_DATA_DIRS=/usr/share/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop
start-env = XDG_RUNTIME_DIR=/run/user/1000
start-env = XDG_SESSION_TYPE=x11

I'm connecting to it from the host using Xpra 3.0-22235 64-bit on Windows 10 Pro 1803.
"C:\Program Files\Xpra\Xpra.exe" attach --encoding=rgb --compressors=lz4 tcp://uuu:xxx@

Attachments (2)

icon-premult.png (4.2 KB) - added by Vincent Huisman 2 weeks ago.
Garbled icon
icon-nopremult.png (2.3 KB) - added by Vincent Huisman 2 weeks ago.
Icon after disabling BGRA premult

Download all attachments as: .zip

Change History (3)

Changed 2 weeks ago by Vincent Huisman

Attachment: icon-premult.png added

Garbled icon

Changed 2 weeks ago by Vincent Huisman

Attachment: icon-nopremult.png added

Icon after disabling BGRA premult

comment:1 Changed 2 weeks ago by Antoine Martin

Resolution: duplicate
Status: newclosed

See #2252

Note: See TracTickets for help on using tickets.