JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
removed sendevent
authorAnselm R. Garbe <arg@suckless.org>
Mon, 26 Feb 2007 15:24:51 +0000 (16:24 +0100)
committerAnselm R. Garbe <arg@suckless.org>
Mon, 26 Feb 2007 15:24:51 +0000 (16:24 +0100)
client.c
dwm.h
main.c

index d180278..e599203 100644 (file)
--- a/client.c
+++ b/client.c
@@ -154,10 +154,19 @@ focus(Client *c) {
 
 void
 killclient(const char *arg) {
+       XEvent ev;
+
        if(!sel)
                return;
-       if(isprotodel(sel))
-               sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
+       if(isprotodel(sel)) {
+               ev.type = ClientMessage;
+               ev.xclient.window = sel->win;
+               ev.xclient.message_type = wmatom[WMProtocols];
+               ev.xclient.format = 32;
+               ev.xclient.data.l[0] = wmatom[WMDelete];
+               ev.xclient.data.l[1] = CurrentTime;
+               XSendEvent(dpy, sel->win, False, NoEventMask, &ev);
+       }
        else
                XKillClient(dpy, sel->win);
 }
diff --git a/dwm.h b/dwm.h
index c00f691..0a259f8 100644 (file)
--- a/dwm.h
+++ b/dwm.h
@@ -130,7 +130,6 @@ void zoom(const char *arg);         /* zooms the focused client to master area, arg is
 
 /* main.c */
 void quit(const char *arg);            /* quit dwm nicely */
-void sendevent(Window w, Atom a, long value);  /* send synthetic event to w */
 int xerror(Display *dsply, XErrorEvent *ee);   /* dwm's X error handler */
 
 /* tag.c */
diff --git a/main.c b/main.c
index e6ba20c..8b67408 100644 (file)
--- a/main.c
+++ b/main.c
@@ -222,20 +222,6 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
 /* extern */
 
 void
-sendevent(Window w, Atom a, long value) {
-       XEvent e;
-
-       e.type = ClientMessage;
-       e.xclient.window = w;
-       e.xclient.message_type = a;
-       e.xclient.format = 32;
-       e.xclient.data.l[0] = value;
-       e.xclient.data.l[1] = CurrentTime;
-       XSendEvent(dpy, w, False, NoEventMask, &e);
-       XSync(dpy, False);
-}
-
-void
 quit(const char *arg) {
        readin = running = False;
 }