summaryrefslogtreecommitdiff
path: root/app/cwm/xevents.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2016-09-14 19:45:34 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2016-09-14 19:45:34 +0000
commita1c64b0066756da8ec1a1955bf9ce8773e85adc0 (patch)
tree899f40b5054445691361cbf9711171f4fb820daa /app/cwm/xevents.c
parent9ee3dc3a1a0d5c369240dd8d21010f4394536207 (diff)
Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag
instead of relying on curcc.
Diffstat (limited to 'app/cwm/xevents.c')
-rw-r--r--app/cwm/xevents.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c
index 07091685e..d82a3d2c7 100644
--- a/app/cwm/xevents.c
+++ b/app/cwm/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