From 67a9eaa440ddc535fc7707883baca9f263cf4ae8 Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 2 Sep 2016 15:08:44 +0000 Subject: [PATCH] Simplify toggling flags; from Vadim Vygonets. --- client.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/client.c b/client.c index fb3fe31..7a073c8 100644 --- a/client.c +++ b/client.c @@ -256,33 +256,21 @@ client_toggle_freeze(struct client_ctx *cc) if (cc->flags & CLIENT_FULLSCREEN) return; - if (cc->flags & CLIENT_FREEZE) - cc->flags &= ~CLIENT_FREEZE; - else - cc->flags |= CLIENT_FREEZE; - + cc->flags ^= CLIENT_FREEZE; xu_ewmh_set_net_wm_state(cc); } void client_toggle_hidden(struct client_ctx *cc) { - if (cc->flags & CLIENT_HIDDEN) - cc->flags &= ~CLIENT_HIDDEN; - else - cc->flags |= CLIENT_HIDDEN; - + cc->flags ^= CLIENT_HIDDEN; xu_ewmh_set_net_wm_state(cc); } void client_toggle_sticky(struct client_ctx *cc) { - if (cc->flags & CLIENT_STICKY) - cc->flags &= ~CLIENT_STICKY; - else - cc->flags |= CLIENT_STICKY; - + cc->flags ^= CLIENT_STICKY; xu_ewmh_set_net_wm_state(cc); }