From b96caa16e6a6406a0f837637cd5529f0d778b927 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 13 Sep 2011 08:37:49 +0000 Subject: repair groupcycle (broke after cycle-in-group support added more flags); found by and fix from Thomas Pfaff. ok oga@ --- group.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/group.c b/group.c index e8d23e8..877a824 100644 --- a/group.c +++ b/group.c @@ -313,7 +313,7 @@ group_only(struct screen_ctx *sc, int idx) * Cycle through active groups. If none exist, then just stay put. */ void -group_cycle(struct screen_ctx *sc, int reverse) +group_cycle(struct screen_ctx *sc, int flags) { struct group_ctx *gc, *showgroup = NULL; @@ -321,11 +321,11 @@ group_cycle(struct screen_ctx *sc, int reverse) gc = sc->group_active; for (;;) { - gc = reverse ? TAILQ_PREV(gc, group_ctx_q, entry) : - TAILQ_NEXT(gc, entry); + gc = (flags & CWM_RCYCLE) ? TAILQ_PREV(gc, group_ctx_q, + entry) : TAILQ_NEXT(gc, entry); if (gc == NULL) - gc = reverse ? TAILQ_LAST(&sc->groupq, group_ctx_q) : - TAILQ_FIRST(&sc->groupq); + gc = (flags & CWM_RCYCLE) ? TAILQ_LAST(&sc->groupq, + group_ctx_q) : TAILQ_FIRST(&sc->groupq); if (gc == sc->group_active) break; -- cgit 1.4.1 From 796b32123d88fd5946c97fb79ad551600c772f62 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 13 Sep 2011 08:41:57 +0000 Subject: add WM_TRANSIENT_FOR event support: moves dialogs, toolbars and such to the group of the main application window; based on a diff from Alexander Polakov with CLIENT_IGNORE flag suggestion from oga@. ok oga@ --- calmwm.h | 1 + client.c | 17 +++++++++++++++++ xevents.c | 3 +++ 3 files changed, 21 insertions(+) diff --git a/calmwm.h b/calmwm.h index 2f1c6c2..b69fdf8 100644 --- a/calmwm.h +++ b/calmwm.h @@ -328,6 +328,7 @@ void client_send_delete(struct client_ctx *); void client_setactive(struct client_ctx *, int); void client_setname(struct client_ctx *); int client_snapcalc(int, int, int, int, int); +void client_transient(struct client_ctx *); void client_unhide(struct client_ctx *); void client_vertmaximize(struct client_ctx *); void client_warp(struct client_ctx *); diff --git a/client.c b/client.c index e7783a4..711aeba 100644 --- a/client.c +++ b/client.c @@ -113,6 +113,8 @@ client_new(Window win, struct screen_ctx *sc, int mapped) XAddToSaveSet(X_Dpy, cc->win); + client_transient(cc); + /* Notify client of its configuration. */ xu_configure(cc); @@ -869,6 +871,21 @@ client_freehints(struct client_ctx *cc) XFree(cc->app_class); } +void +client_transient(struct client_ctx *cc) +{ + struct client_ctx *tc; + Window trans; + + if (XGetTransientForHint(X_Dpy, cc->win, &trans)) { + if ((tc = client_find(trans)) && tc->group) { + group_movetogroup(cc, tc->group->shortcut - 1); + if (tc->flags & CLIENT_IGNORE) + cc->flags |= CLIENT_IGNORE; + } + } +} + static int client_inbound(struct client_ctx *cc, int x, int y) { diff --git a/xevents.c b/xevents.c index 34dd051..6c4ba71 100644 --- a/xevents.c +++ b/xevents.c @@ -191,6 +191,9 @@ xev_handle_propertynotify(XEvent *ee) case XA_WM_NAME: client_setname(cc); break; + case XA_WM_TRANSIENT_FOR: + client_transient(cc); + break; default: /* do nothing */ break; -- cgit 1.4.1 From 22f366830e6fc06931f9e0a905e6c34fab0f7a20 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 13 Sep 2011 09:17:30 +0000 Subject: fix spelling I keep getting wrong for some unknown reason; found by and diff from Alexander Polakov. --- conf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf.c b/conf.c index e8cd157..963a399 100644 --- a/conf.c +++ b/conf.c @@ -67,10 +67,10 @@ conf_font(struct conf *c, struct screen_ctx *sc) } static struct color color_binds[] = { - { "#CCCCCC", 0 }, /* CWM_COLOR_BORDOR_ACTIVE */ - { "#666666", 0 }, /* CWM_COLOR_BORDOR_INACTIVE */ - { "blue", 0 }, /* CWM_COLOR_BORDOR_GROUP */ - { "red", 0 }, /* CWM_COLOR_BORDOR_UNGROUP */ + { "#CCCCCC", 0 }, /* CWM_COLOR_BORDER_ACTIVE */ + { "#666666", 0 }, /* CWM_COLOR_BORDER_INACTIVE */ + { "blue", 0 }, /* CWM_COLOR_BORDER_GROUP */ + { "red", 0 }, /* CWM_COLOR_BORDER_UNGROUP */ { "black", 0 }, /* CWM_COLOR_FG_MENU */ { "white", 0 }, /* CWM_COLOR_BG_MENU */ { "black", 0 }, /* CWM_COLOR_FONT */ -- cgit 1.4.1