From 21f94c6aa8f7753b6ba8e738bcdcf29567e3f7f9 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 14 Sep 2016 19:45:33 +0000 Subject: Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag instead of relying on curcc. --- xevents.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xevents.c') diff --git a/xevents.c b/xevents.c index 0709168..d82a3d2 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.120 2015/11/10 20:05:33 okan Exp $ + * $OpenBSD: xevents.c,v 1.121 2016/09/14 19:45:33 okan Exp $ */ /* @@ -250,10 +250,13 @@ xev_handle_buttonpress(XEvent *ee) static void xev_handle_buttonrelease(XEvent *ee) { - struct client_ctx *cc; + XButtonEvent *e = &ee->xbutton; + struct client_ctx *cc; - if ((cc = client_current()) != NULL) - group_toggle_membership_leave(cc); + if ((cc = client_find(e->window)) != NULL) { + if (cc->flags & CLIENT_ACTIVE) + group_toggle_membership_leave(cc); + } } static void -- cgit v1.2.3-2-gb3c3