On Sat, May 23, 2009 at 02:12:59PM +0200, Samir SAADA wrote:
>  Thanks for this patch Pavel,
> I enjoy using it, but I am a bit confused when hiding the app and find myself
> on another workspace, the app's one; just different from the menu's hide 
> behavior.

You're right Samir, thanks for reporting that.  The original patch
was somewhat sloppy and I should have reviewed it before sending.

I'm attaching the new patch, its behavior should now be identical
to that of Menu->Hide.
diff -ru WindowMaker-0.92.0.orig/src/appicon.c WindowMaker-0.92.0/src/appicon.c
--- WindowMaker-0.92.0.orig/src/appicon.c	2004-10-14 21:31:49.000000000 +0400
+++ WindowMaker-0.92.0/src/appicon.c	2009-05-23 20:45:41.000000000 +0400
@@ -554,16 +554,21 @@
     }
 #endif
 
-    unhideHere = (event->xbutton.state & ShiftMask);
+    if (event->xbutton.button == Button5) {
+        if (!wapp->flags.hidden)
+            wHideApplication(wapp);
+    } else {
+        unhideHere = (event->xbutton.state & ShiftMask);
+
+        /* go to the last workspace that the user worked on the app */
+        if (!unhideHere && wapp->last_workspace != scr->current_workspace)
+            wWorkspaceChange(scr, wapp->last_workspace);
 
-    /* go to the last workspace that the user worked on the app */
-    if (!unhideHere && wapp->last_workspace != scr->current_workspace)
-        wWorkspaceChange(scr, wapp->last_workspace);
+        wUnhideApplication(wapp, event->xbutton.button==Button2, unhideHere);
 
-    wUnhideApplication(wapp, event->xbutton.button==Button2, unhideHere);
-
-    if (event->xbutton.state & MOD_MASK) {
-        wHideOtherApplications(aicon->icon->owner);
+        if (event->xbutton.state & MOD_MASK) {
+            wHideOtherApplications(aicon->icon->owner);
+        }
     }
 }
 
diff -ru WindowMaker-0.92.0.orig/src/dock.c WindowMaker-0.92.0/src/dock.c
--- WindowMaker-0.92.0.orig/src/dock.c	2004-10-23 07:10:40.000000000 +0400
+++ WindowMaker-0.92.0/src/dock.c	2009-05-23 20:45:42.000000000 +0400
@@ -3564,18 +3564,23 @@
 
         assert(wapp!=NULL);
 
-        unhideHere = (event->xbutton.state & ShiftMask);
+        if (event->xbutton.button == Button5) {
+            if (!wapp->flags.hidden)
+                wHideApplication(wapp);
+        } else {
+            unhideHere = (event->xbutton.state & ShiftMask);
 
-        /* go to the last workspace that the user worked on the app */
-        if (wapp->last_workspace != dock->screen_ptr->current_workspace
-            && !unhideHere) {
-            wWorkspaceChange(dock->screen_ptr, wapp->last_workspace);
-        }
+            /* go to the last workspace that the user worked on the app */
+            if (wapp->last_workspace != dock->screen_ptr->current_workspace
+                    && !unhideHere) {
+                wWorkspaceChange(dock->screen_ptr, wapp->last_workspace);
+            }
 
-        wUnhideApplication(wapp, event->xbutton.button==Button2, unhideHere);
+            wUnhideApplication(wapp, event->xbutton.button==Button2, unhideHere);
 
-        if (event->xbutton.state & MOD_MASK) {
-            wHideOtherApplications(btn->icon->owner);
+            if (event->xbutton.state & MOD_MASK) {
+                wHideOtherApplications(btn->icon->owner);
+            }
         }
     } else {
         if (event->xbutton.button==Button1) {

Reply via email to