Quoth I,

Adding Control + double click as an alternative way to invoke the
new functionality would be just a few extra lines of code.

  And here they are.
From 73f18c71cab2ab6dd4bc6d7abd6b641ae689a0ad Mon Sep 17 00:00:00 2001
From: Iain Patterson <[email protected]>
Date: Mon, 2 Apr 2012 11:11:30 +0100
Subject: [PATCH 4/4] Also relaunch from appicon with Ctrl + DblClick.

Zoltan Balaton points out that Control + Doubleclick on docked app will
launch a new instance.  For consistency with that behaviour we now allow
Control + Doubleclick on an undocked appicon to invoke the new
relaunching functionality.

We also now restrict doubleclick handling to the left mouse button in
order to avoid relaunching the application twice when the middle button
is used.
---
 src/appicon.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index 19f5614..80f08f4 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -497,8 +497,13 @@ static void iconDblClick(WObjDescriptor * desc, XEvent * 
event)
        assert(aicon->icon->owner != NULL);
 
        wapp = wApplicationOf(aicon->icon->owner->main_window);
-       unhideHere = (event->xbutton.state & ShiftMask);
 
+       if (event->xbutton.state & ControlMask) {
+               relaunchApplication(wapp);
+               return;
+       }
+
+       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);
@@ -535,7 +540,9 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
                return;
 
        if (IsDoubleClick(scr, event)) {
-               iconDblClick(desc, event);
+               /* Middle or right mouse actions were handled on first click */
+               if (event->xbutton.button == Button1)
+                       iconDblClick(desc, event);
                return;
        }
 
-- 
1.7.7.6

Reply via email to