summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-16 04:51:06 +0000
committerDana Jansens <danakj@orodu.net>2002-07-16 04:51:06 +0000
commit94d86896b499b75aab5a587a958b2245282d9353 (patch)
tree151bcbab08e1984c53df602134491ad0ff69156f /src
parentede324b490eb1f9d43f4d7aa9c19343d978c93ce (diff)
add sendClientMessage
Diffstat (limited to 'src')
-rw-r--r--src/XAtom.cc22
-rw-r--r--src/XAtom.hh5
2 files changed, 27 insertions, 0 deletions
diff --git a/src/XAtom.cc b/src/XAtom.cc
index f6d0be73..b2a7c4ef 100644
--- a/src/XAtom.cc
+++ b/src/XAtom.cc
@@ -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);
+}
diff --git a/src/XAtom.hh b/src/XAtom.hh
index 6e232c85..8c790bf6 100644
--- a/src/XAtom.hh
+++ b/src/XAtom.hh
@@ -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];