Closed tuurep closed 5 months ago
In the wmctrl code the client_msg
was always given five 0
s as parameters, which I just removed back then.
Initializing all five cells as 0
again gets rid of the valgrind warning.
It's cryptic to me what the purpose of data.l
actually is:
https://tronche.com/gui/x/xlib/events/client-communication/client-message.html
the [...] l members represent data of [...] 5 32-bit values.
Very well then?
Ah, this explains more:
https://www.x.org/releases/X11R7.5/doc/man/man3/XClientMessageEvent.3.html
The message_type member is set to an atom that indicates how the data should be interpreted by the receiving client. The format member is set to 8, 16, or 32 and specifies whether the data should be viewed as a list of bytes, shorts, or longs. The data member is a union that contains the members b, s, and l. The b, s, and l members represent data of twenty 8-bit values, ten 16-bit values, and five 32-bit values. Particular message types might not make use of all these values. The X server places no interpretation on the values in the window, message_type, or data members.
So because we set event.xclient.format = 32
, we have to set the l
array respectively.
But it doesn't seem hugely useful for us.
The
client_msg
function is used only by click-actionsraise
andclose
.Running with valgrind gives warnings such as:
$ valgrind --leak-check=full --track-origins=yes ./raise 0x0140003d
Googling around I find something like this:
https://stackoverflow.com/a/5844281
Will fix, if I can figure out how.