summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client.c13
-rw-r--r--dwm.h1
-rw-r--r--main.c14
3 files changed, 11 insertions, 17 deletions
diff --git a/client.c b/client.c
index d180278..e599203 100644
--- a/client.c
+++ b/client.c
@@ -154,10 +154,19 @@ focus(Client *c) {
154 154
155void 155void
156killclient(const char *arg) { 156killclient(const char *arg) {
157 XEvent ev;
158
157 if(!sel) 159 if(!sel)
158 return; 160 return;
159 if(isprotodel(sel)) 161 if(isprotodel(sel)) {
160 sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); 162 ev.type = ClientMessage;
163 ev.xclient.window = sel->win;
164 ev.xclient.message_type = wmatom[WMProtocols];
165 ev.xclient.format = 32;
166 ev.xclient.data.l[0] = wmatom[WMDelete];
167 ev.xclient.data.l[1] = CurrentTime;
168 XSendEvent(dpy, sel->win, False, NoEventMask, &ev);
169 }
161 else 170 else
162 XKillClient(dpy, sel->win); 171 XKillClient(dpy, sel->win);
163} 172}
diff --git a/dwm.h b/dwm.h
index c00f691..0a259f8 100644
--- a/dwm.h
+++ b/dwm.h
@@ -130,7 +130,6 @@ void zoom(const char *arg); /* zooms the focused client to master area, arg is
130 130
131/* main.c */ 131/* main.c */
132void quit(const char *arg); /* quit dwm nicely */ 132void quit(const char *arg); /* quit dwm nicely */
133void sendevent(Window w, Atom a, long value); /* send synthetic event to w */
134int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ 133int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
135 134
136/* tag.c */ 135/* tag.c */
diff --git a/main.c b/main.c
index e6ba20c..8b67408 100644
--- a/main.c
+++ b/main.c
@@ -222,20 +222,6 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
222/* extern */ 222/* extern */
223 223
224void 224void
225sendevent(Window w, Atom a, long value) {
226 XEvent e;
227
228 e.type = ClientMessage;
229 e.xclient.window = w;
230 e.xclient.message_type = a;
231 e.xclient.format = 32;
232 e.xclient.data.l[0] = value;
233 e.xclient.data.l[1] = CurrentTime;
234 XSendEvent(dpy, w, False, NoEventMask, &e);
235 XSync(dpy, False);
236}
237
238void
239quit(const char *arg) { 225quit(const char *arg) {
240 readin = running = False; 226 readin = running = False;
241} 227}