mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Add option to allow starting DockApps with a single click
This patch is from the contrib directory. It adds an option to allow starting DockApps with a single click. It's a handy option that adds only a few lines to the code. It is a good feature patch example because it includes modifications to the WPrefs application so that the feature can be easily enabled or disabled. The one-click ability allows wmaker to integrate more seemlessly with programs like ROX-Filer which can be configured to use single or double click actions. The README in the contrib/ directory says, author: Sebastien Bauer <seb_bauer@bigfoot.com> John Morrissey <jwm@horde.net> updated for Window Maker 0.65.0 by: Daniel Richard G. <skunk@graphics.lcs.mit.edu> updated for Window Maker 0.80.2 by: Martial Daumas <martial@nasgaia.org> update for 0.80.2+ by: steve lion <steve.lion@verizon.net> and vlaad
This commit is contained in:
committed by
Carlos R. Mafra
parent
c04a2caeab
commit
f8dd3dc49e
15
src/dock.c
15
src/dock.c
@@ -3501,7 +3501,7 @@ static void handleDockMove(WDock * dock, WAppIcon * aicon, XEvent * event)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void handleIconMove(WDock * dock, WAppIcon * aicon, XEvent * event)
|
||||
static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
{
|
||||
WScreen *scr = dock->screen_ptr;
|
||||
Window wins[2];
|
||||
@@ -3518,6 +3518,7 @@ static void handleIconMove(WDock * dock, WAppIcon * aicon, XEvent * event)
|
||||
Bool docked;
|
||||
int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
|
||||
int omnipresent = aicon->omnipresent; /* this must be cached!!! */
|
||||
Bool hasMoved = False;
|
||||
|
||||
if (wPreferences.flags.noupdates)
|
||||
return;
|
||||
@@ -3567,6 +3568,7 @@ static void handleIconMove(WDock * dock, WAppIcon * aicon, XEvent * event)
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
hasMoved = True;
|
||||
if (!grabbed) {
|
||||
if (abs(ofs_x - ev.xmotion.x) >= MOVE_THRESHOLD
|
||||
|| abs(ofs_y - ev.xmotion.y) >= MOVE_THRESHOLD) {
|
||||
@@ -3712,9 +3714,10 @@ static void handleIconMove(WDock * dock, WAppIcon * aicon, XEvent * event)
|
||||
#ifdef DEBUG
|
||||
puts("End icon move");
|
||||
#endif
|
||||
return;
|
||||
return hasMoved;;
|
||||
}
|
||||
}
|
||||
return False; /* never reached */
|
||||
}
|
||||
|
||||
static int getClipButton(int px, int py)
|
||||
@@ -3841,9 +3844,11 @@ static void iconMouseDown(WObjDescriptor * desc, XEvent * event)
|
||||
handleClipChangeWorkspace(scr, event);
|
||||
else
|
||||
handleDockMove(dock, aicon, event);
|
||||
} else
|
||||
handleIconMove(dock, aicon, event);
|
||||
|
||||
} else {
|
||||
Bool hasMoved = handleIconMove(dock, aicon, event);
|
||||
if (wPreferences.single_click && !hasMoved)
|
||||
iconDblClick(desc, event);
|
||||
}
|
||||
} else if (event->xbutton.button == Button2 && dock->type == WM_CLIP && aicon == scr->clip_icon) {
|
||||
if (!scr->clip_ws_menu) {
|
||||
scr->clip_ws_menu = wWorkspaceMenuMake(scr, False);
|
||||
|
||||
Reference in New Issue
Block a user