1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 22:28:02 +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:
Sebastien Bauer
2009-09-03 04:08:58 +02:00
committed by Carlos R. Mafra
parent c04a2caeab
commit f8dd3dc49e
6 changed files with 26 additions and 6 deletions

View File

@@ -532,6 +532,7 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
Bool movingSingle = False;
int oldX = x;
int oldY = y;
Bool hasMoved = False;
if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
return;
@@ -611,6 +612,7 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
break;
case MotionNotify:
hasMoved = True;
if (!grabbed) {
if (abs(dx - ev.xmotion.x) >= MOVE_THRESHOLD
|| abs(dy - ev.xmotion.y) >= MOVE_THRESHOLD) {
@@ -745,6 +747,9 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
if (wPreferences.auto_arrange_icons)
wArrangeIcons(scr, True);
if (wPreferences.single_click && !hasMoved)
iconDblClick(desc, event);
done = 1;
break;
}