aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calmwm.h4
-rw-r--r--client.c13
-rw-r--r--xevents.c22
3 files changed, 9 insertions, 30 deletions
diff --git a/calmwm.h b/calmwm.h
index 9d7d722..aa8493b 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.227 2013/11/08 17:35:12 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.228 2013/11/12 21:25:00 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -370,7 +370,7 @@ struct client_ctx *client_current(void);
void client_cycle(struct screen_ctx *, int);
void client_cycle_leave(struct screen_ctx *,
struct client_ctx *);
-void client_delete(struct client_ctx *, int);
+void client_delete(struct client_ctx *);
void client_draw_border(struct client_ctx *);
struct client_ctx *client_find(Window);
void client_freeze(struct client_ctx *);
diff --git a/client.c b/client.c
index 9d448fd..fadbc18 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.148 2013/11/11 12:51:15 okan Exp $
+ * $OpenBSD: client.c,v 1.149 2013/11/12 21:25:00 okan Exp $
*/
#include <sys/param.h>
@@ -149,20 +149,11 @@ client_init(Window win, struct screen_ctx *sc, int mapped)
}
void
-client_delete(struct client_ctx *cc, int destroy)
+client_delete(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
struct winname *wn;
- if (destroy) {
- XGrabServer(X_Dpy);
- cc->state = WithdrawnState;
- xu_set_wm_state(cc->win, cc->state);
- XRemoveFromSaveSet(X_Dpy, cc->win);
- XSync(X_Dpy, False);
- XUngrabServer(X_Dpy);
- }
-
TAILQ_REMOVE(&sc->mruq, cc, mru_entry);
TAILQ_REMOVE(&Clientq, cc, entry);
diff --git a/xevents.c b/xevents.c
index d92386b..854df0c 100644
--- a/xevents.c
+++ b/xevents.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xevents.c,v 1.91 2013/10/25 19:46:16 okan Exp $
+ * $OpenBSD: xevents.c,v 1.92 2013/11/12 21:25:00 okan Exp $
*/
/*
@@ -97,27 +97,15 @@ static void
xev_handle_unmapnotify(XEvent *ee)
{
XUnmapEvent *e = &ee->xunmap;
- XEvent ev;
struct client_ctx *cc;
- /* XXX, we need a recursive locking wrapper around grab server */
- XGrabServer(X_Dpy);
if ((cc = client_find(e->window)) != NULL) {
- /*
- * If it's going to die anyway, nuke it.
- *
- * Else, if it's a synthetic event delete state, since they
- * want it to be withdrawn. ICCM recommends you withdraw on
- * this even if we haven't alredy been told to iconify, to
- * deal with legacy clients.
- */
- if (XCheckTypedWindowEvent(X_Dpy, cc->win,
- DestroyNotify, &ev) || e->send_event != 0) {
- client_delete(cc, 1);
+ if (e->send_event) {
+ cc->state = WithdrawnState;
+ xu_set_wm_state(cc->win, cc->state);
} else
client_hide(cc);
}
- XUngrabServer(X_Dpy);
}
static void
@@ -127,7 +115,7 @@ xev_handle_destroynotify(XEvent *ee)
struct client_ctx *cc;
if ((cc = client_find(e->window)) != NULL)
- client_delete(cc, 0);
+ client_delete(cc);
}
static void