diff options
author | okan | 2016-09-14 19:45:33 +0000 |
---|---|---|
committer | okan | 2016-09-14 19:45:33 +0000 |
commit | 21f94c6aa8f7753b6ba8e738bcdcf29567e3f7f9 (patch) | |
tree | 34fb0000ffe68dda325f0ce700df305d7f91a109 /xevents.c | |
parent | 94f916d33826c67c48de8587c500ea39d746630d (diff) | |
download | cwm-21f94c6aa8f7753b6ba8e738bcdcf29567e3f7f9.tar.gz |
Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag
instead of relying on curcc.
Diffstat (limited to '')
-rw-r--r-- | xevents.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 |