FreeRDP/client/X11
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
..
cli Removed winpr_exit 2018-04-03 12:56:33 +02:00
resource implemented floatbar for x11 2018-09-18 21:25:51 +02:00
.gitignore Add an environment variables section to the man 2016-06-21 15:28:38 +02:00
CMakeLists.txt implemented floatbar for x11 2018-09-18 21:25:51 +02:00
generate_argument_docbook.c client/x11: Silence false positive warnings from covscan 2018-08-22 13:35:43 +02:00
ModuleOptions.cmake freerdp: remove vendor-specific options from build system, add automatic ways of including external clients/servers 2013-09-03 20:37:04 -04:00
xf_channels.c Fixed load/unload for display channel. 2018-09-24 16:44:25 +02:00
xf_channels.h Follow up fix for #4631 2018-06-18 10:44:35 +02:00
xf_client.c added missing check for remote app where no floatbar exists 2018-10-18 15:33:01 +02:00
xf_client.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_cliprdr.c Skip empty server format response. 2018-09-24 12:47:46 +02:00
xf_cliprdr.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_disp.c Fixed compiler warnings. 2018-10-03 15:16:59 +02:00
xf_disp.h Fixed load/unload for display channel. 2018-09-24 16:44:25 +02:00
xf_event.c Merge pull request #4885 from akallabeth/autoreconnect_handle_window_events 2018-10-03 09:42:16 +02:00
xf_event.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_floatbar.c fix [x11]: compiler warnings in floatbar 2018-10-19 11:33:28 +02:00
xf_floatbar.h implemented floatbar for x11 2018-09-18 21:25:51 +02:00
xf_gdi.c Fixed -Wextra sign warnings 2018-10-24 13:25:31 +02:00
xf_gdi.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_gfx.c Merge pull request #4322 from akallabeth/rail_fixes 2018-04-11 10:49:44 +02:00
xf_gfx.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_graphics.c Fixed XPixmap checks. 2018-04-04 10:46:14 +02:00
xf_graphics.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_input.c Fixed PubSub function pointer casts. 2018-02-14 11:00:52 +01:00
xf_input.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_keyboard.c Fixed -Wextra sign warnings 2018-10-24 13:25:31 +02:00
xf_keyboard.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_monitor.c Fixed signedness of MoniorCount 2018-10-25 14:08:20 +02:00
xf_monitor.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_rail.c xfreerdp: set _NET_WM_ICON to RAIL app icon 2018-11-14 10:53:45 +01:00
xf_rail.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_tsmf.c fix string format specifiers 2016-12-16 13:48:43 +01:00
xf_tsmf.h Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
xf_video.c Fixed code duplication. 2018-02-13 10:52:53 +01:00
xf_video.h Fixed #4493: duplicate typedef. 2018-03-17 15:25:41 +01:00
xf_window.c xfreerdp: set _NET_WM_ICON to RAIL app icon 2018-11-14 10:53:45 +01:00
xf_window.h implemented floatbar for x11 2018-09-18 21:25:51 +02:00
xfreerdp-channels.1.xml Removed placeholder for channel documentation until it is available. 2013-08-06 12:25:38 +02:00
xfreerdp-envvar.1.xml Fix issues in wlog man page 2016-12-01 15:36:31 +01:00
xfreerdp-examples.1.xml extend /size to allow width or height percentages (#4146) 2017-09-25 09:35:49 +02:00
xfreerdp.1.xml.in Add an environment variables section to the man 2016-06-21 15:28:38 +02:00
xfreerdp.h xfreerdp: add RAIL icon cache 2018-11-14 10:53:45 +01:00