From 056a290a7deec098de72f81a48edbb83b1faf42f Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 2 Apr 2012 11:11:30 +0100 Subject: [PATCH] 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 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/appicon.c b/src/appicon.c index 19f56148..80f08f46 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; }