clicking the active window iconifies it
authorDana Jansens <danakj@orodu.net>
Mon, 11 Jun 2007 03:39:54 +0000 (03:39 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 11 Jun 2007 03:39:54 +0000 (03:39 +0000)
rspanel.c

index 6cbd19c..36c5d30 100644 (file)
--- a/rspanel.c
+++ b/rspanel.c
@@ -374,7 +374,11 @@ static void handle_press(int x, int y, int button, Time time)
             {
                 switch (button) {
                 case 1:
-                    netwm_action(tk->win, _NET_ACTIVE_WINDOW, time, 0);
+                    if (tk->focused) /* iconify if focused */
+                        netwm_action(tk->win, _NET_WM_STATE_HIDDEN,
+                                     time, XPROP_ADD);
+                    else
+                        netwm_action(tk->win, _NET_ACTIVE_WINDOW, time, 0);
                     break;
                 case 2:
                     if (tk->iconified)