aboutsummaryrefslogtreecommitdiffstats
path: root/xevents.c
diff options
context:
space:
mode:
authorokan2016-09-14 19:45:33 +0000
committerokan2016-09-14 19:45:33 +0000
commit21f94c6aa8f7753b6ba8e738bcdcf29567e3f7f9 (patch)
tree34fb0000ffe68dda325f0ce700df305d7f91a109 /xevents.c
parent94f916d33826c67c48de8587c500ea39d746630d (diff)
downloadcwm-21f94c6aa8f7753b6ba8e738bcdcf29567e3f7f9.tar.gz
Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag
instead of relying on curcc.
Diffstat (limited to 'xevents.c')
-rw-r--r--xevents.c11
1 files changed, 7 insertions, 4 deletions
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