From cca26e1f1f03f960a178d49fa0a22f2b53e58059 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Sun, 22 Jan 2012 22:19:12 +0200 Subject: rename sendevent() to deletewindow() as it was the only message sent also it implemented a crappy check for the existance of the atom --- monsterwm.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/monsterwm.c b/monsterwm.c index 3da7b35..6a7fb8d 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -115,6 +115,7 @@ static void cleanup(void); static void client_to_desktop(const Arg *arg); static void clientmessage(XEvent *e); static void configurerequest(XEvent *e); +static void deletewindow(Window w); static void desktopinfo(void); static void destroynotify(XEvent *e); static void die(const char* errstr, ...); @@ -143,7 +144,6 @@ static void rotate_desktop(const Arg *arg); static void run(void); static void save_desktop(int i); static void select_desktop(int i); -static void sendevent(Window w, int atom); static void setfullscreen(client *c, Bool fullscreen); static void setup(void); static void sigchld(); @@ -268,7 +268,7 @@ void cleanup(void) { XUngrabKey(dis, AnyKey, AnyModifier, root); XQueryTree(dis, root, &root_return, &parent_return, &children, &nchildren); - for (unsigned int i = 0; iwin, WM_DELETE_WINDOW); + deletewindow(current->win); removeclient(current); } @@ -783,19 +795,6 @@ void select_desktop(int i) { current_desktop = i; } -/* send the given event - WM_DELETE_WINDOW for now */ -void sendevent(Window w, int atom) { - if (atom >= WM_COUNT) return; - XEvent ev; - ev.type = ClientMessage; - ev.xclient.window = w; - ev.xclient.message_type = wmatoms[WM_PROTOCOLS]; - ev.xclient.format = 32; - ev.xclient.data.l[0] = wmatoms[atom]; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dis, w, False, NoEventMask, &ev); -} - /* set or unset fullscreen state of client */ void setfullscreen(client *c, Bool fullscreen) { XChangeProperty(dis, c->win, netatoms[NET_WM_STATE], XA_ATOM, 32, PropModeReplace, (unsigned char*) -- cgit v1.3.1