1 This patch allows dock icons, appicons and miniwindows to be activated with
2 a single-click (as opposed to a double-click). Great for weary fingers!
4 Index: WPrefs.app/Expert.c
5 ===================================================================
6 RCS file: /cvsroot/wm/WPrefs.app/Expert.c,v
7 retrieving revision 1.25
8 diff -u -r1.25 Expert.c
9 --- WPrefs.app/Expert.c 23 Oct 2004 03:30:04 -0000 1.25
10 +++ WPrefs.app/Expert.c 23 Oct 2004 04:16:07 -0000
12 WMSetButtonSelected(panel->swi[4], GetBoolForKey("DontConfirmKill"));
13 WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
14 WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
15 + WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
20 panel->box = WMCreateBox(panel->parent);
21 WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
23 - for (i=0; i<7; i++) {
24 + for (i=0; i<8; i++) {
25 panel->swi[i] = WMCreateSwitchButton(panel->box);
26 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
27 WMMoveWidget(panel->swi[i], 20, 20+i*25);
29 WMSetButtonText(panel->swi[4], _("Disable confirmation panel for the Kill command."));
30 WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons."));
31 WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
32 + WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
34 WMSetButtonEnabled(panel->swi[6], True);
37 SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DontConfirmKill");
38 SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
39 SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
40 + SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
44 Index: src/WindowMaker.h
45 ===================================================================
46 RCS file: /cvsroot/wm/src/WindowMaker.h,v
47 retrieving revision 1.60
48 diff -u -r1.60 WindowMaker.h
49 --- src/WindowMaker.h 18 Oct 2004 01:30:02 -0000 1.60
50 +++ src/WindowMaker.h 23 Oct 2004 04:16:07 -0000
52 unsigned int workspace_border_size; /* Size in pixels of the workspace border */
53 char workspace_border_position; /* Where to leave a workspace border */
55 + /* single click to lauch applications */
59 unsigned int nodock:1; /* don't display the dock */
60 unsigned int noclip:1; /* don't display the clip */
62 ===================================================================
63 RCS file: /cvsroot/wm/src/appicon.c,v
64 retrieving revision 1.50
65 diff -u -r1.50 appicon.c
66 --- src/appicon.c 13 Oct 2004 05:09:08 -0000 1.50
67 +++ src/appicon.c 23 Oct 2004 04:16:08 -0000
69 Bool movingSingle = False;
72 + Bool hasMoved = False;
74 if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
82 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
83 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
85 if (wPreferences.auto_arrange_icons)
86 wArrangeIcons(scr, True);
88 + if (wPreferences.single_click && !hasMoved)
89 + iconDblClick(desc, event);
95 ===================================================================
96 RCS file: /cvsroot/wm/src/defaults.c,v
97 retrieving revision 1.90
98 diff -u -r1.90 defaults.c
99 --- src/defaults.c 22 Oct 2004 23:39:11 -0000 1.90
100 +++ src/defaults.c 23 Oct 2004 04:16:08 -0000
102 {"DisableBlinking", "NO", NULL,
103 &wPreferences.dont_blink, getBool, NULL
105 + {"SingleClickLaunch", "NO", NULL,
106 + &wPreferences.single_click, getBool, NULL
109 {"MenuStyle", "normal", seMenuStyles,
110 &wPreferences.menu_style, getEnum, setMenuStyle
112 ===================================================================
113 RCS file: /cvsroot/wm/src/dock.c,v
114 retrieving revision 1.91
115 diff -u -r1.91 dock.c
116 --- src/dock.c 23 Oct 2004 03:30:04 -0000 1.91
117 +++ src/dock.c 23 Oct 2004 04:16:09 -0000
118 @@ -3758,7 +3758,7 @@
124 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
126 WScreen *scr = dock->screen_ptr;
127 @@ -3776,6 +3776,7 @@
129 int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
130 int omnipresent = aicon->omnipresent; /* this must be cached!!! */
131 + Bool hasMoved = False;
134 if (wPreferences.flags.noupdates)
135 @@ -3828,6 +3829,7 @@
141 if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
142 || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
143 @@ -3977,9 +3979,11 @@
145 puts("End icon move");
152 + return False; /* never reached */
156 @@ -4116,8 +4120,11 @@
157 handleClipChangeWorkspace(scr, event);
159 handleDockMove(dock, aicon, event);
161 - handleIconMove(dock, aicon, event);
163 + Bool hasMoved = handleIconMove(dock, aicon, event);
164 + if (wPreferences.single_click && !hasMoved)
165 + iconDblClick(desc, event);
168 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
169 aicon==scr->clip_icon) {
171 ===================================================================
172 RCS file: /cvsroot/wm/src/icon.c,v
173 retrieving revision 1.27
174 diff -u -r1.27 icon.c
175 --- src/icon.c 16 Oct 2004 22:05:04 -0000 1.27
176 +++ src/icon.c 23 Oct 2004 04:16:10 -0000
178 int dx=event->xbutton.x, dy=event->xbutton.y;
180 int clickButton=event->xbutton.button;
181 + Bool hasMoved = False;
183 if (WCHECK_STATE(WSTATE_MODAL))
191 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
192 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
195 if (wPreferences.auto_arrange_icons)
196 wArrangeIcons(wwin->screen_ptr, True);
197 + if (wPreferences.single_click && !hasMoved)
198 + miniwindowDblClick(desc, event);