]> code.delx.au - spectrwm/commitdiff
Fix window border colors when moving windows to hidden workspaces.
authorReginald Kennedy <rk@rejii.com>
Tue, 18 Feb 2014 02:40:38 +0000 (10:40 +0800)
committerReginald Kennedy <rk@rejii.com>
Thu, 20 Feb 2014 04:27:50 +0000 (12:27 +0800)
Fixes #31

spectrwm.c

index a90eb31625d276818efcddbed79b6e9c85f1a5cd..0589ebd9807a0bd07a9b52b48f2e89cd7cad6e57 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (c) 2009 Pierre-Yves Ritschard <pyr@spootnik.org>
  * Copyright (c) 2010 Tuukka Kataja <stuge@xor.fi>
  * Copyright (c) 2011 Jason L. Wright <jason@thought.net>
- * Copyright (c) 2011-2013 Reginald Kennedy <rk@rejii.com>
+ * Copyright (c) 2011-2014 Reginald Kennedy <rk@rejii.com>
  * Copyright (c) 2011-2012 Lawrence Teo <lteo@lteo.net>
  * Copyright (c) 2011-2012 Tiago Cunha <tcunha@gmx.com>
  * Copyright (c) 2012-2013 David Hill <dhill@mindcry.org>
@@ -3584,13 +3584,15 @@ focus_win(struct ws_win *win)
 
                set_region(ws->r);
 
-               update_window_color(win);
-
                xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win->s->root,
                    ewmh[_NET_ACTIVE_WINDOW].atom, XCB_ATOM_WINDOW, 32, 1,
                    &win->id);
        }
 
+       if (cfw != win)
+               /* Update window border even if workspace is hidden. */
+               update_window_color(win);
+
 out:
        bar_draw();
 
@@ -5038,10 +5040,14 @@ send_to_ws(struct swm_region *r, union arg *args)
 
        win_to_ws(win, wsid, 1);
 
-       /* Set window to be focus on target ws. */
+       /* Set new focus on target ws. */
        if (focus_mode != SWM_FOCUS_FOLLOW) {
+               win->ws->focus_prev = win->ws->focus;
                win->ws->focus = win;
                win->ws->focus_pending = NULL;
+
+               if (win->ws->focus_prev)
+                       update_window_color(win->ws->focus_prev);
        }
 
        DNPRINTF(SWM_D_STACK, "send_to_ws: focus_pending: %#x, focus: %#x, "
@@ -5053,7 +5059,7 @@ send_to_ws(struct swm_region *r, union arg *args)
        ewmh_apply_flags(win, win->ewmh_flags & ~EWMH_F_MAXIMIZED);
        ewmh_update_wm_state(win);
 
-       /* Restack and set new focus. */
+       /* Restack and set new focus on current ws. */
        if (FLOATING(win))
                load_float_geom(win);