listen on _NET_ACTIVE_WINDOW instead of FocusIn
authorMikael Magnusson <mikachu@comhem.se>
Mon, 4 Jun 2007 20:35:18 +0000 (20:35 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Mon, 4 Jun 2007 20:35:18 +0000 (20:35 +0000)
rspanel.c

index a2cc172..519aa7d 100644 (file)
--- a/rspanel.c
+++ b/rspanel.c
@@ -1148,6 +1148,7 @@ static void handle_press(int x, int y, int button, Time time)
     }
 }
 
+#if 0
 static void handle_focusin(Window win)
 {
     task *tk;
@@ -1168,13 +1169,17 @@ static void handle_focusin(Window win)
         tk = tk->next;
     }
 }
+#endif
 
 static void handle_propertynotify(Window win, Atom at)
 {
     task *tk;
 
     if (win == root_win) {
-        if (at == atoms[_NET_CLIENT_LIST] || at == atoms[_NET_CURRENT_DESKTOP] || at == atoms[_NET_CLIENT_LIST_STACKING]) {
+        /* XXX only redraw the task that got focused/unfocused when _NET_ACTIVE_WINDOW triggers this */
+        if (at == atoms[_NET_CLIENT_LIST] || at == atoms[_NET_CURRENT_DESKTOP]
+            || at == atoms[_NET_CLIENT_LIST_STACKING] || at == atoms[_NET_ACTIVE_WINDOW])
+        {
             taskbar_read_clientlist();
             gui_draw_taskbar();
         }
@@ -1272,10 +1277,6 @@ main(int argc, char *argv[])
         case PropertyNotify:
             handle_propertynotify(ev.xproperty.window, ev.xproperty.atom);
             break;
-        case FocusIn:
-            if (ev.xfocus.mode != NotifyGrab)
-                handle_focusin(ev.xfocus.window);
-            break;
         /*default:
                printf ("unknown evt type: %d\n", ev.type); */
         }