From 6a19e3f41a1b445b44d0fbd760f0c6c9550c3aee Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Fri, 20 Jul 2012 18:51:42 +0300 Subject: update comments for focus function --- monsterwm.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/monsterwm.c b/monsterwm.c index e586d6d..6b80ac7 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -440,19 +440,11 @@ void enternotify(XEvent *e) { } /** - * set current/active/focused and previously focused client - * (iow manage curr and prev references) - * - * restack clients - * - * highlight borders and set active window property and - * give input focus to the current/active/focused client - * - * a window should have borders in any case, except if - * - the window is fullscreen - * - the window is not floating or transient and - * - the mode is MONOCLE or, - * - it is the only window on screen + * 1. set current/active/focused and previously focused client + * in other words, manage curr and prev references + * 2. restack clients + * 3. highlight borders and set active window property + * 4. give input focus to the current/active/focused client */ void focus(Client *c, Desktop *d) { /* update references to prev and curr, @@ -524,6 +516,13 @@ void focus(Client *c, Desktop *d) { w[(d->curr->isfloat || d->curr->istrans) ? 0:ft] = d->curr->win; for (fl += !ISFFT(d->curr) ? 1:0, c = d->head; c; c = c->next) { XSetWindowBorder(dis, c->win, c == d->curr ? win_focus:win_unfocus); + /* + * a window should have borders in any case, except if + * - the window is fullscreen + * - the window is not floating or transient and + * - the mode is MONOCLE or, + * - it is the only window on screen + */ XSetWindowBorderWidth(dis, c->win, c->isfull || (!ISFFT(c) && (d->mode == MONOCLE || !d->head->next)) ? 0:BORDER_WIDTH); if (c != d->curr) w[c->isfull ? --fl:ISFFT(c) ? --ft:--n] = c->win; -- cgit v1.3.1