1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 22:52:34 +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

@@ -814,6 +814,7 @@ static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
int dx = event->xbutton.x, dy = event->xbutton.y;
int grabbed = 0;
int clickButton = event->xbutton.button;
Bool hasMoved = False;
if (WCHECK_STATE(WSTATE_MODAL))
return;
@@ -863,6 +864,7 @@ static void miniwindowMouseDown(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) {
@@ -900,6 +902,8 @@ static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
if (wPreferences.auto_arrange_icons)
wArrangeIcons(wwin->screen_ptr, True);
if (wPreferences.single_click && !hasMoved)
miniwindowDblClick(desc, event);
return;
}