removed sendevent

master
Anselm R. Garbe 2007-02-26 16:24:51 +01:00
parent ee8fb0c6e4
commit bab5b1178d
3 changed files with 11 additions and 17 deletions

View File

@ -154,10 +154,19 @@ focus(Client *c) {
void void
killclient(const char *arg) { killclient(const char *arg) {
XEvent ev;
if(!sel) if(!sel)
return; return;
if(isprotodel(sel)) if(isprotodel(sel)) {
sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); 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 else
XKillClient(dpy, sel->win); XKillClient(dpy, sel->win);
} }

1
dwm.h
View File

@ -130,7 +130,6 @@ void zoom(const char *arg); /* zooms the focused client to master area, arg is
/* main.c */ /* main.c */
void quit(const char *arg); /* quit dwm nicely */ 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 */ int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
/* tag.c */ /* tag.c */

14
main.c
View File

@ -221,20 +221,6 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
/* extern */ /* 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 void
quit(const char *arg) { quit(const char *arg) {
readin = running = False; readin = running = False;