Startup notification protocol sample code sets the first byte of the message to zero
Alex Henrie
alexhenrie24 at gmail.com
Thu Oct 29 19:37:46 PDT 2015
Hi,
I am trying to clean up some code that uses _NET_STARTUP_INFO_BEGIN,
but the example in the specification at
<http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt>
does not make sense to me. The example has:
if (src == message)
{
*dest = '\0';
++dest;
}
As far as I can tell, the only time when src equals message is the
first time through the loop, but the specification doesn't say
anything about the first byte of the message having to be null. In
fact, it says that the null byte must be interpreted as the end of the
message:
The last byte used in the last client message must be nul, and no
intermediate bytes may be nul. The nul byte identifies
the end of the message.
Then, at the end of the loop, we have:
xevent.xclient.message_type = type_atom_begin;
Shouldn't this say "xevent.xclient.message_type = type_atom"?
Otherwise, you're redundantly setting message_type again and again
even though it was already set to type_atom_begin before the start of
the loop.
The more I think about it, the more I think that these have got to be
errors in the spec. Can the spec be revised to give a correct example?
-Alex
More information about the xdg
mailing list