// Select the proper union structure for the event type and populate it
event.setType(XClientMessageEvent.class);
event.xclient.type = X11.ClientMessage;
event.xclient.serial = new NativeLong(0L);
event.xclient.send_event = TRUE;
event.xclient.message_type = x.XInternAtom(display, msg, false);
event.xclient.window = new com.sun.jna.platform.unix.X11.Window(wid);
event.xclient.format = 32;
// Select the proper union structure for the event data and populate it
event.xclient.data.setType(NativeLong[].class);
event.xclient.data.l[0] = data0;