# This is a BitKeeper generated patch for the following project: # Project Name: Lightweight Window Manager # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.3 -> 1.4 # disp.c 1.2 -> 1.3 # lwm.h 1.2 -> 1.3 # client.c 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/02/11 jcopenha@marco.(none) 1.4 # close doesn't happen until releasing the mouse button # -------------------------------------------- # diff -Nru a/client.c b/client.c --- a/client.c Mon Feb 11 14:51:15 2002 +++ b/client.c Mon Feb 11 14:51:15 2002 @@ -115,6 +115,7 @@ c->wmcmaps = 0; c->accepts_focus = 1; c->next = clients; + c->needclose = False; /* Add to head of list of clients. */ return (clients = c); diff -Nru a/disp.c b/disp.c --- a/disp.c Mon Feb 11 14:51:15 2002 +++ b/disp.c Mon Feb 11 14:51:15 2002 @@ -126,7 +126,7 @@ /* The ``box''. */ quarter = (border + titleHeight()) / 4; if (e->x > (quarter + 2) && e->x < (3 + 3*quarter) && e->y > quarter && e->y <= 3*quarter) { - Client_Close(c); + c->needclose = True; return; } @@ -174,7 +174,8 @@ /* Deal with root window button presses. */ if (e->window == e->root) { - if (e->button == LAUNCH_BUTTON) { + /* Make the menuhit and shell/launch buttons #defines */ + if(e->button == LAUNCH_BUTTON) { shell(getScreenFromRoot(e->root), e->button, e->x, e->y); } else if (e->button == MENU_BUTTON) { cmapfocus(0); @@ -185,11 +186,24 @@ static void buttonrelease(XEvent *ev) { + Client *c = NULL; + int quarter; + XButtonEvent *e = &ev->xbutton; + quarter = (border + titleHeight()) / 4; + c = Client_Get(e->window); + if (mode == wm_menu_up) menu_buttonrelease(ev); else if (mode == wm_reshaping) XUnmapWindow(dpy, current_screen->popup); + if(c && c->needclose) + if (e->x > (quarter + 2) && e->x < (3 + 3*quarter) && e->y > quarter && e->y <= 3*quarter) + Client_Close(c); + else + c->needclose = False; + + mode = wm_idle; } diff -Nru a/lwm.h b/lwm.h --- a/lwm.h Mon Feb 11 14:51:15 2002 +++ b/lwm.h Mon Feb 11 14:51:15 2002 @@ -106,6 +106,8 @@ int ncmapwins; Window * cmapwins; Colormap * wmcmaps; + + Bool needclose; };