-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Take a look at window-icon-updater (in master branch - planned for R3.1):
https://github.com/QubesOS/qubes-gui-daemon/tree/master/window-icon-updater
https://github.com/QubesOS/qubes-gui-agent-linux/tree/master/window-icon-updater
It uses similar approach to retrieve application icon. This is done in
separate qrexec connection, because icons are quite complex, require
additional processing (coloring) etc. So it's better to not put this
into GUI protocol, which should remain as simple as possible (better to
have two simple protocols, than one complex).
You can use similar approach for WM_CLASS. It will be an overkill, but
at least it doesn't require modifying GUI protocol, carrying custom
patch etc.
That said, I think adding WM_CLASS should not introduce any more
complexity to the GUI protocol. For backward compatibility it should be
separate message. This leads to some design questions:
Background:
- --------------
http://tronche.com/gui/x/icccm/sec-4.html
4.1.2.5. WM_CLASS Property
The WM_CLASS property (of type STRING without control characters)
contains two consecutive null-terminated strings. These specify the
Instance and Class names to be used by both the client and the window
manager for looking up resources for the application or as identifying
information. This property must be present when the window leaves the
Withdrawn state and may be changed only while the window is in the
Withdrawn state. Window managers may examine the property only when they
start up and when the window leaves the Withdrawn state, but there
should be no need for a client to change its state dynamically.
The two strings, respectively, are:
A string that names the particular instance of the application to
which the client that owns this window belongs. Resources that are
specified by instance name override any resources that are specified by
class name. Instance names can be specified by the user in an
operating-system specific manner. On POSIX-conformant systems, the
following conventions are used:
If "-name NAME" is given on the command line, NAME is used as
the instance name.
Otherwise, if the environment variable RESOURCE_NAME is set, its
value will be used as the instance name.
Otherwise, the trailing part of the name used to invoke the
program (argv[0] stripped of any directory names) is used as the
instance name.
A string that names the general class of applications to which the
client that owns this window belongs. Resources that are specified by
class apply to all applications that have the same class name. Class
names are specified by the application writer. Examples of commonly used
class names include: "Emacs", "XTerm", "XClock", "XLoad", and so on.
Note that WM_CLASS strings are null-terminated and, thus, differ from
the general conventions that STRING properties are null-separated. This
inconsistency is necessary for backwards compatibility.
Questions:
- -----------
1. Should the VM name be prepended to the class name? Or instance name? Or
both?
2. If any of above "yes" - what should be the separator? ":"?
3. Should the application be able to change class/instance later, or
just set it once (some stronger than "may be changed only while the
window is in the Withdrawn state").
4. What should be set if VM application did not provided the
class/instance name? Set VM name there as it is done currently?
5. What should be general constraints on those two strings? Especially
maximum length and allowed characters.
And when when we settle on some design, if you want this feature sooner
than later, feel free to provide a patches :)
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBCAAGBQJWJ7MgAAoJENuP0xzK19csxNQIAJXbIo7nQ1A+58nXJK32J8vn
VhtitkvG4XJ8bS2sk9HIhUtQAH5aQslBqruYwzeFpyC6ultx44aI6yDdnA9T01rb
Z1S/6WMStLwcIkc//2ebNP3pEvOFxywgyqiZ5NXDqNohnHFI2GCYKSwD1ptwudIC
AF/N8sSU1g7e5K1JDMhpgqu4Iqa5hJFGEh/yevNRw4Gt3L8P0saMeVXPfBj0dsMe
Jv6DxokqxoGOIkZCyoGQxGg/EUrTNh4Ps0U9Qld5vmYIT2UeRqo6ZXyhSUk7EgxA
rg4DITqoH/1pQoOBd+xsOtSOv2ZNL0Mt0dtVJewhni4pChF33kV+2YH/YDHHBB4=
=f9dS
-----END PGP SIGNATURE-----