wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

sendmessage.c (635B)


      1 /* Copyright ©2007-2010 Kris Maglione <maglione.k at Gmail>
      2  * See LICENSE file for license details.
      3  */
      4 #include "x11.h"
      5 #include <string.h>
      6 
      7 void
      8 sendmessage(Window *w, const char *name, long l0, long l1, long l2, long l3, long l4) {
      9 
     10 	clientmessage(w, name, NoEventMask, 32, (ClientMessageData){ .l = { l0, l1, l2, l3, l4 } });
     11 }
     12 
     13 void
     14 clientmessage(Window *w, const char *name, long mask, int format, ClientMessageData data) {
     15 	XClientMessageEvent e;
     16 
     17 	e.type = ClientMessage;
     18 	e.window = w->xid;
     19 	e.message_type = xatom(name);
     20 	e.format = format;
     21 	bcopy(&data, &e.data, sizeof(data));
     22 	sendevent(w, false, mask, (XEvent*)&e);
     23 }
     24