]> Dogcows Code - chaz/openbox/commitdiff
add sendClientMessage
authorDana Jansens <danakj@orodu.net>
Tue, 16 Jul 2002 04:51:06 +0000 (04:51 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 16 Jul 2002 04:51:06 +0000 (04:51 +0000)
src/XAtom.cc
src/XAtom.hh

index f6d0be730f82a5e0deda8b3be4b16ab80b4b5bbc..b2a7c4efae9369820c81526c974b4e79c1da6468 100644 (file)
@@ -491,3 +491,25 @@ void XAtom::eraseValue(Window win, Atoms atom) const {
   assert(atom >= 0 && atom < NUM_ATOMS);
   XDeleteProperty(_display, win, _atoms[atom]);
 }
+
+
+void XAtom::sendClientMessage(Window target, Atoms type, Window about,
+                              long data, long data1, long data2,
+                              long data3) const {
+  assert(atom >= 0 && atom < NUM_ATOMS);
+  assert(target != None);
+
+  XEvent e;
+  e.xclient.type = ClientMessage;
+  e.xclient.format = 32;
+  e.xclient.message_type = _atoms[type];
+  e.xclient.window = about;
+  e.xclient.data.l[0] = data;
+  e.xclient.data.l[1] = data1;
+  e.xclient.data.l[2] = data2;
+  e.xclient.data.l[3] = data3;
+
+  XSendEvent(_display, target, False,
+             SubstructureRedirectMask | SubstructureNotifyMask,
+             &e);
+}
index 6e232c85e327d3b8e9b2ffb1d78ab03443f488c1..8c790bf654df54cb348d691de8e36aa90c9a1f5d 100644 (file)
@@ -212,6 +212,11 @@ public:
   
   void eraseValue(Window win, Atoms atom) const;
 
+  // sends a client message a window
+  void sendClientMessage(Window target, Atoms type, Window about,
+                         long data = 0, long data1 = 0, long data2 = 0,
+                         long data3 = 0) const;
+
   // temporary function!! remove when not used in blackbox.hh anymore!!
   inline Atom getAtom(Atoms a)
   { assert(a >= 0 && a < NUM_ATOMS); Atom ret = _atoms[a];
This page took 0.023299 seconds and 4 git commands to generate.