Undim switchpanel icons when selecting windows directly.
authorIain Patterson <wm@iain.cx>
Fri, 24 May 2013 13:14:34 +0000 (24 14:14 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Fri, 24 May 2013 14:00:24 +0000 (24 15:00 +0100)
If one or more icons were dimmed in the switchpanel because the user
used GroupNext/PrevKey, then an icon was selected with the mouse or the
Home or End keys, dimmed icons remained dim.  That could be unintuitive
if the selected window was of a different class.

Instead we now always redraw all icons when highlighting a different
icon.

src/switchpanel.c

index 6c8f6ea..cfb0033 100644 (file)
@@ -625,12 +625,16 @@ WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back)
 {
        WWindow *wwin;
        int count = WMGetArrayItemCount(panel->windows);
+       int i;
 
        if (count == 0)
                return NULL;
 
-       if (panel->win)
-               changeImage(panel, panel->current, 0, False);
+       if (panel->win) {
+               WM_ITERATE_ARRAY(panel->windows, wwin, i) {
+                       changeImage(panel, i, 0, False);
+               }
+       }
 
        if (back) {
                panel->current = count - 1;
@@ -671,7 +675,9 @@ WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event)
        if (focus >= 0 && panel->current != focus) {
                WWindow *wwin;
 
-               changeImage(panel, panel->current, 0, False);
+               WM_ITERATE_ARRAY(panel->windows, wwin, i) {
+                       changeImage(panel, i, 0, False);
+               }
                changeImage(panel, focus, 1, False);
                panel->current = focus;