missing function declaration
[wmaker-crm.git] / contrib / single_click.diff
blob2ad1983bd526f68f81e48b049415f101f099cf76
1 diff -urN WindowMaker-0.62.1/WPrefs.app/Expert.c WindowMaker-0.62.1.patched/WPrefs.app/Expert.c
2 --- WindowMaker-0.62.1/WPrefs.app/Expert.c Fri Sep 17 17:03:54 1999
3 +++ WindowMaker-0.62.1.patched/WPrefs.app/Expert.c Wed Aug 16 20:43:48 2000
4 @@ -33,7 +33,7 @@
6 WMWindow *win;
8 - WMButton *swi[8];
9 + WMButton *swi[9];
11 } _Panel;
13 @@ -53,6 +53,7 @@
14 WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
15 WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking"));
16 WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
17 + WMSetButtonSelected(panel->swi[6], GetBoolForKey("SingleClickLaunch"));
21 @@ -66,7 +67,7 @@
22 WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
23 WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
25 - for (i=0; i<6; i++) {
26 + for (i=0; i<7; i++) {
27 panel->swi[i] = WMCreateSwitchButton(panel->frame);
28 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
29 WMMoveWidget(panel->swi[i], 20, 20+i*25);
30 @@ -78,6 +79,7 @@
31 WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects"));
32 WMSetButtonText(panel->swi[4], _("Disable cycling color highlighting of icons."));
33 WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command."));
34 + WMSetButtonText(panel->swi[6], _("Launch applications and restore windows with a single click"));
36 WMRealizeWidget(panel->frame);
37 WMMapSubwidgets(panel->frame);
38 @@ -99,6 +101,7 @@
39 SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
40 SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking");
41 SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
42 + SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "SingleClickLaunch");
46 diff -urN WindowMaker-0.62.1/src/WindowMaker.h WindowMaker-0.62.1.patched/src/WindowMaker.h
47 --- WindowMaker-0.62.1/src/WindowMaker.h Tue Mar 28 22:23:38 2000
48 +++ WindowMaker-0.62.1.patched/src/WindowMaker.h Wed Aug 16 20:37:00 2000
49 @@ -416,6 +416,9 @@
50 /* shading animation */
51 signed char shade_speed;
53 + /* single click to lauch applications */
54 + char single_click;
56 int edge_resistance;
57 char attract;
59 diff -urN WindowMaker-0.62.1/src/appicon.c WindowMaker-0.62.1.patched/src/appicon.c
60 --- WindowMaker-0.62.1/src/appicon.c Wed Mar 29 21:52:10 2000
61 +++ WindowMaker-0.62.1.patched/src/appicon.c Wed Aug 16 20:37:00 2000
62 @@ -717,6 +717,7 @@
63 int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
64 int ix, iy;
65 int clickButton = event->xbutton.button;
66 + Bool hasMoved;
67 Pixmap ghost = None;
68 Window wins[2];
70 @@ -786,6 +787,7 @@
71 XClearWindow(dpy, scr->dock_shadow);
74 + hasMoved = False;
75 while (!done) {
76 WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
77 |ButtonMotionMask|ExposureMask, &ev);
78 @@ -795,6 +797,7 @@
79 break;
81 case MotionNotify:
82 + hasMoved = True;
83 if (!grabbed) {
84 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
85 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
86 @@ -925,6 +928,9 @@
87 wArrangeIcons(scr, True);
89 done = 1;
90 + if (!hasMoved && wPreferences.single_click) {
91 + iconDblClick(desc, event);
92 + }
93 break;
96 diff -urN WindowMaker-0.62.1/src/defaults.c WindowMaker-0.62.1.patched/src/defaults.c
97 --- WindowMaker-0.62.1/src/defaults.c Tue Mar 28 22:58:25 2000
98 +++ WindowMaker-0.62.1.patched/src/defaults.c Wed Aug 16 20:37:58 2000
99 @@ -530,6 +530,9 @@
100 {"DisableBlinking", "NO", NULL,
101 &wPreferences.dont_blink, getBool, NULL
103 + {"SingleClickLaunch", "NO", NULL,
104 + &wPreferences.single_click, getBool, NULL
105 + },
106 /* style options */
107 {"MenuStyle", "normal", seMenuStyles,
108 &wPreferences.menu_style, getEnum, setMenuStyle
109 diff -urN WindowMaker-0.62.1/src/dock.c WindowMaker-0.62.1.patched/src/dock.c
110 --- WindowMaker-0.62.1/src/dock.c Wed Mar 29 21:52:10 2000
111 +++ WindowMaker-0.62.1.patched/src/dock.c Wed Aug 16 20:40:15 2000
112 @@ -3750,7 +3750,7 @@
116 -static void
117 +static int
118 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
120 WScreen *scr = dock->screen_ptr;
121 @@ -3765,11 +3765,11 @@
122 int ix = aicon->xindex, iy = aicon->yindex;
123 int tmp;
124 Pixmap ghost = None;
125 - Bool docked;
126 + Bool docked, hasMoved;
127 int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
128 int omnipresent = aicon->omnipresent; /* this must be cached!!! */
131 + hasMoved = False;
132 if (wPreferences.flags.noupdates)
133 return;
135 @@ -3820,6 +3820,7 @@
136 break;
138 case MotionNotify:
139 + hasMoved = True;
140 if (!grabbed) {
141 if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
142 || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
143 @@ -3975,7 +3976,10 @@
144 #ifdef DEBUG
145 puts("End icon move");
146 #endif
147 - return;
148 + if (!hasMoved) {
149 + return 1;
151 + return 0;
155 @@ -4115,7 +4119,9 @@
156 else
157 handleDockMove(dock, aicon, event);
158 } else
159 - handleIconMove(dock, aicon, event);
160 + if (handleIconMove(dock, aicon, event) != 0 &&
161 + wPreferences.single_click)
162 + iconDblClick(desc, event);
164 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
165 aicon==scr->clip_icon) {
166 diff -urN WindowMaker-0.62.1/src/icon.c WindowMaker-0.62.1.patched/src/icon.c
167 --- WindowMaker-0.62.1/src/icon.c Thu Jan 20 06:51:44 2000
168 +++ WindowMaker-0.62.1.patched/src/icon.c Wed Aug 16 20:37:00 2000
169 @@ -874,6 +874,7 @@
170 int dx=event->xbutton.x, dy=event->xbutton.y;
171 int grabbed=0;
172 int clickButton=event->xbutton.button;
173 + Bool hasMoved;
175 if (WCHECK_STATE(WSTATE_MODAL))
176 return;
177 @@ -916,6 +917,7 @@
178 wwarning("pointer grab failed for icon move");
179 #endif
181 + hasMoved = False;
182 while(1) {
183 WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
184 |ButtonMotionMask|ExposureMask, &ev);
185 @@ -925,6 +927,7 @@
186 break;
188 case MotionNotify:
189 + hasMoved = True;
190 if (!grabbed) {
191 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
192 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
193 @@ -962,6 +965,9 @@
195 if (wPreferences.auto_arrange_icons)
196 wArrangeIcons(wwin->screen_ptr, True);
197 + if (!hasMoved && wPreferences.single_click) {
198 + miniwindowDblClick(desc, event);
200 return;