aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2012-12-17 17:48:57 +0000
committerokan2012-12-17 17:48:57 +0000
commit7bb305fa2e37defb54ef76fc2e83cc6c997ad01b (patch)
treed817707685a9d95e2ab559d34f2e9d0046e911e2
parentc69d019777780018c85d66208a69dae5f2e015a4 (diff)
downloadcwm-7bb305fa2e37defb54ef76fc2e83cc6c997ad01b.tar.gz
replace client highlight with a client flag
-rw-r--r--calmwm.h8
-rw-r--r--client.c9
-rw-r--r--group.c12
3 files changed, 13 insertions, 16 deletions
diff --git a/calmwm.h b/calmwm.h
index 8e3f62f..4540aca 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -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: calmwm.h,v 1.168 2012/12/17 14:58:46 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.169 2012/12/17 17:48:57 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -159,16 +159,16 @@ struct client_ctx {
#define CLIENT_VMAXIMIZED 0x0004
#define CLIENT_HMAXIMIZED 0x0008
#define CLIENT_FREEZE 0x0010
+#define CLIENT_GROUP 0x0020
+#define CLIENT_UNGROUP 0x0040
+#define CLIENT_HIGHLIGHT (CLIENT_GROUP | CLIENT_UNGROUP)
#define CLIENT_MAXFLAGS (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
#define CLIENT_MAXIMIZED (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
int flags;
int state;
int active;
int stackingorder;
-#define CLIENT_HIGHLIGHT_GROUP 0x0001
-#define CLIENT_HIGHLIGHT_UNGROUP 0x0002
- int highlight;
struct winname_q nameq;
#define CLIENT_MAXNAMEQLEN 5
int nameqlen;
diff --git a/client.c b/client.c
index f7faed3..5ff06fa 100644
--- a/client.c
+++ b/client.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: client.c,v 1.105 2012/12/17 14:58:46 okan Exp $
+ * $OpenBSD: client.c,v 1.106 2012/12/17 17:48:57 okan Exp $
*/
#include <sys/param.h>
@@ -490,7 +490,6 @@ client_unhide(struct client_ctx *cc)
{
XMapRaised(X_Dpy, cc->win);
- cc->highlight = 0;
cc->flags &= ~CLIENT_HIDDEN;
xu_setstate(cc, NormalState);
client_draw_border(cc);
@@ -503,11 +502,11 @@ client_draw_border(struct client_ctx *cc)
unsigned long pixel;
if (cc->active)
- switch (cc->highlight) {
- case CLIENT_HIGHLIGHT_GROUP:
+ switch (cc->flags & CLIENT_HIGHLIGHT) {
+ case CLIENT_GROUP:
pixel = sc->color[CWM_COLOR_BORDER_GROUP].pixel;
break;
- case CLIENT_HIGHLIGHT_UNGROUP:
+ case CLIENT_UNGROUP:
pixel = sc->color[CWM_COLOR_BORDER_UNGROUP].pixel;
break;
default:
diff --git a/group.c b/group.c
index 4c268c7..35e0574 100644
--- a/group.c
+++ b/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: group.c,v 1.65 2012/12/17 14:32:39 okan Exp $
+ * $OpenBSD: group.c,v 1.66 2012/12/17 17:48:57 okan Exp $
*/
#include <sys/param.h>
@@ -218,16 +218,14 @@ void
group_sticky_toggle_enter(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
- struct group_ctx *gc;
-
- gc = sc->group_active;
+ struct group_ctx *gc = sc->group_active;
if (gc == cc->group) {
group_remove(cc);
- cc->highlight = CLIENT_HIGHLIGHT_UNGROUP;
+ cc->flags |= CLIENT_UNGROUP;
} else {
group_add(gc, cc);
- cc->highlight = CLIENT_HIGHLIGHT_GROUP;
+ cc->flags |= CLIENT_GROUP;
}
client_draw_border(cc);
@@ -236,7 +234,7 @@ group_sticky_toggle_enter(struct client_ctx *cc)
void
group_sticky_toggle_exit(struct client_ctx *cc)
{
- cc->highlight = 0;
+ cc->flags &= ~CLIENT_HIGHLIGHT;
client_draw_border(cc);
}