FreeRDP/client
ilammy 9292b2231f xfreerdp: set _NET_WM_ICON to RAIL app icon
Icons on X11 windows are configured using the _NET_WM_ICON property
described in Extended Window Manager Hints. Here we implement converison
from DIB bitmaps used by RAIL to the format expected by _NET_WM_ICON,
and actually set the icon for RAIL app windows.

Both DIB format and _NET_WM_ICON (or rather, Xlib) are weird. Let's
start with RAIL's format. That's the one used in BMP and ICO formats
on Windows. It has some strange properties but thankfully FreeRDP's
freerdp_image_copy() can handle most of them for us. (With an exception
of monochrome and 16-color formats that it does not support. Sorry, but
I'm too lazy to fix them. They are not seem to be used by any real
application either.) The one thing that it can't do is to apply the
alpha transparency bitmask so we have to do it manually. This instantly
reminds us that DIB format has HISTORY: it's vertically flipped and
each must be padded to 4 bytes. Both these quirks having reasonable
(for a certain definition of 'reason') explanations. Such is life.
(Also, 8-bit images require a color palette which we must fill in.)

So okay, now comes _NET_WM_ICON. It is more sane (or rather, easier to
deal with). The bitmap is represented with a tiny [width, height] header
followed by an array of pixels in ARGB format. There is no padding, no
weird color formats. But here's a catch: you can't simply take the
output of freerdp_image_copy() and cast to (unsigned char*) of colors.
We have to allocate an array of C's longs and copy the pixels there,
because that's what Xlib expects (and this is mentioned in the spec).
Simply casting an array of bytes causes crashes on 64-bit systems.
So don't try to cheat or "optimize" and read the docs, kids.

Note that XFlush() call after XChangeProperty(). It's there because it
seems to helps see the icon quicker with Unity on Ubuntu 14.04. I don't
know why. (And Unity does not support _NET_WM_ICON officially. But it
sorta kinda works sometimes.)

Oh, and while we're here, delete some old, unused, and commented out
code that was setting window icons in the past. It's not needed anymore.
2018-11-14 10:53:45 +01:00
..
Android Merge pull request #4906 from FeLvi-zzz/japanese-patch 2018-10-02 15:46:17 +02:00
DirectFB Removed winpr_exit 2018-04-03 12:56:33 +02:00
Mac Fix #4851: Software GDI is now default 2018-09-20 10:44:03 +02:00
Sample Removed winpr_exit 2018-04-03 12:56:33 +02:00
Wayland Fix #4851: Software GDI is now default 2018-09-20 10:44:03 +02:00
Windows Merge pull request #4865 from mmattes/feature/floatbar 2018-09-25 16:34:20 +02:00
X11 xfreerdp: set _NET_WM_ICON to RAIL app icon 2018-11-14 10:53:45 +01:00
common fix [cmdline]: parameter parsing 2018-11-08 11:13:57 +01:00
iOS Fixed PubSub function pointer casts. 2018-02-14 11:00:52 +01:00
.gitignore wlfreerdp: add initial man page 2017-01-16 11:11:59 +01:00
CMakeLists.txt Use SetFreeRDPCMakeInstallDir where CMake modules are installed 2018-05-02 10:36:52 -05:00
FreeRDP-ClientConfig.cmake.in appropriate names in server & client cmake exports 2016-02-03 13:37:35 +01:00
freerdp-client.pc.in Include major version number in library names 2017-01-16 11:11:58 +01:00