Again, don't be rude on people.
[wmaker-crm.git] / contrib / single_click.diff
bloba6e3456ae795cb8bbed54505539c17a35b99b453
1 diff -rc WindowMaker-0.52.0.ori/WPrefs.app/Appearance.c WindowMaker-0.52.0/WPrefs.app/Appearance.c
2 *** WindowMaker-0.52.0.ori/WPrefs.app/Appearance.c Mon Mar 22 12:16:49 1999
3 --- WindowMaker-0.52.0/WPrefs.app/Appearance.c Wed Apr 21 08:24:11 1999
4 ***************
5 *** 1286,1315 ****
7 setupTextureFor(panel->texLs, "FTitleBack", "(solid, black)",
8 "[Focused]", i);
9 ! panel->textureIndex[i] = i++;
11 setupTextureFor(panel->texLs, "UTitleBack", "(solid, gray)",
12 "[Unfocused]", i);
13 ! panel->textureIndex[i] = i++;
15 setupTextureFor(panel->texLs, "PTitleBack", "(solid, \"#616161\")",
16 "[Owner of Focused]", i);
17 ! panel->textureIndex[i] = i++;
19 setupTextureFor(panel->texLs, "MenuTitleBack", "(solid, black)",
20 "[Menu Title]", i);
21 ! panel->textureIndex[i] = i++;
23 setupTextureFor(panel->texLs, "MenuTextBack", "(solid, gray)",
24 "[Menu Item]", i);
25 ! panel->textureIndex[i] = i++;
27 setupTextureFor(panel->texLs, "IconBack", "(solid, gray)", "[Icon]", i);
28 ! panel->textureIndex[i] = i++;
30 setupTextureFor(panel->texLs, "WorkspaceBack", "(solid, black)",
31 "[Workspace]", i);
32 ! panel->textureIndex[i] = i++;
35 updatePreviewBox(panel, EVERYTHING);
36 --- 1286,1315 ----
38 setupTextureFor(panel->texLs, "FTitleBack", "(solid, black)",
39 "[Focused]", i);
40 ! panel->textureIndex[i++] = i;
42 setupTextureFor(panel->texLs, "UTitleBack", "(solid, gray)",
43 "[Unfocused]", i);
44 ! panel->textureIndex[i++] = i;
46 setupTextureFor(panel->texLs, "PTitleBack", "(solid, \"#616161\")",
47 "[Owner of Focused]", i);
48 ! panel->textureIndex[i++] = i;
50 setupTextureFor(panel->texLs, "MenuTitleBack", "(solid, black)",
51 "[Menu Title]", i);
52 ! panel->textureIndex[i++] = i;
54 setupTextureFor(panel->texLs, "MenuTextBack", "(solid, gray)",
55 "[Menu Item]", i);
56 ! panel->textureIndex[i++] = i;
58 setupTextureFor(panel->texLs, "IconBack", "(solid, gray)", "[Icon]", i);
59 ! panel->textureIndex[i++] = i;
61 setupTextureFor(panel->texLs, "WorkspaceBack", "(solid, black)",
62 "[Workspace]", i);
63 ! panel->textureIndex[i++] = i;
66 updatePreviewBox(panel, EVERYTHING);
67 diff -rc WindowMaker-0.52.0.ori/WPrefs.app/Expert.c WindowMaker-0.52.0/WPrefs.app/Expert.c
68 *** WindowMaker-0.52.0.ori/WPrefs.app/Expert.c Thu Mar 18 17:39:22 1999
69 --- WindowMaker-0.52.0/WPrefs.app/Expert.c Thu Apr 15 09:02:54 1999
70 ***************
71 *** 31,37 ****
73 WMWindow *win;
75 ! WMButton *swi[5];
77 } _Panel;
79 --- 31,37 ----
81 WMWindow *win;
83 ! WMButton *swi[6];
85 } _Panel;
87 ***************
88 *** 50,55 ****
89 --- 50,56 ----
90 WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit"));
91 WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
92 WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking"));
93 + WMSetButtonSelected(panel->swi[5], GetBoolForKey("SingleClickLaunch"));
97 ***************
98 *** 63,69 ****
99 WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
100 WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
102 ! for (i=0; i<5; i++) {
103 panel->swi[i] = WMCreateSwitchButton(panel->frame);
104 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
105 WMMoveWidget(panel->swi[i], 20, 20+i*25);
106 --- 64,70 ----
107 WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
108 WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
110 ! for (i=0; i<6; i++) {
111 panel->swi[i] = WMCreateSwitchButton(panel->frame);
112 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
113 WMMoveWidget(panel->swi[i], 20, 20+i*25);
114 ***************
115 *** 74,79 ****
116 --- 75,81 ----
117 WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker"));
118 WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects"));
119 WMSetButtonText(panel->swi[4], _("Disable cycling color highlighting of icons."));
120 + WMSetButtonText(panel->swi[5], _("Launch applications and restore windows with a single click"));
122 WMRealizeWidget(panel->frame);
123 WMMapSubwidgets(panel->frame);
124 ***************
125 *** 94,99 ****
126 --- 96,102 ----
127 SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
128 SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
129 SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking");
130 + SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "SingleClickLaunch");
134 diff -rc WindowMaker-0.52.0.ori/src/WindowMaker.h WindowMaker-0.52.0/src/WindowMaker.h
135 *** WindowMaker-0.52.0.ori/src/WindowMaker.h Mon Mar 22 12:16:50 1999
136 --- WindowMaker-0.52.0/src/WindowMaker.h Wed Apr 14 10:35:40 1999
137 ***************
138 *** 348,353 ****
139 --- 348,356 ----
140 /* shading animation */
141 char shade_speed;
143 + /* single click to lauch applications */
144 + char single_click;
146 int edge_resistance;
148 struct {
149 diff -rc WindowMaker-0.52.0.ori/src/appicon.c WindowMaker-0.52.0/src/appicon.c
150 *** WindowMaker-0.52.0.ori/src/appicon.c Thu Apr 1 12:33:57 1999
151 --- WindowMaker-0.52.0/src/appicon.c Wed Apr 14 10:38:03 1999
152 ***************
153 *** 710,715 ****
154 --- 710,716 ----
155 int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
156 int ix, iy;
157 int clickButton = event->xbutton.button;
158 + Bool hasMoved;
159 Pixmap ghost = None;
161 if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
162 ***************
163 *** 758,763 ****
164 --- 759,765 ----
165 dockable = canBeDocked(icon->owner);
168 + hasMoved = False;
169 while (!done) {
170 WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
171 |ButtonMotionMask|ExposureMask, &ev);
172 ***************
173 *** 767,772 ****
174 --- 769,775 ----
175 break;
177 case MotionNotify:
178 + hasMoved = True;
179 if (!grabbed) {
180 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
181 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
182 ***************
183 *** 917,922 ****
184 --- 920,928 ----
185 XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
187 done = 1;
188 + if (!hasMoved && wPreferences.single_click) {
189 + iconDblClick(desc, event);
191 break;
194 diff -rc WindowMaker-0.52.0.ori/src/defaults.c WindowMaker-0.52.0/src/defaults.c
195 *** WindowMaker-0.52.0.ori/src/defaults.c Mon Mar 22 12:16:51 1999
196 --- WindowMaker-0.52.0/src/defaults.c Wed Apr 14 10:54:24 1999
197 ***************
198 *** 445,450 ****
199 --- 445,453 ----
200 {"DisableBlinking", "NO", NULL,
201 &wPreferences.dont_blink, getBool, NULL
203 + {"SingleClickLaunch", "NO", NULL,
204 + &wPreferences.single_click, getBool, NULL
205 + },
206 #ifdef WEENDOZE_CYCLE
207 {"WindozeCycling","NO", NULL,
208 &wPreferences.windoze_cycling, getBool, NULL
209 diff -rc WindowMaker-0.52.0.ori/src/dock.c WindowMaker-0.52.0/src/dock.c
210 *** WindowMaker-0.52.0.ori/src/dock.c Mon Mar 22 12:16:51 1999
211 --- WindowMaker-0.52.0/src/dock.c Wed Apr 14 10:37:30 1999
212 ***************
213 *** 3484,3490 ****
217 ! static void
218 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
220 WScreen *scr = dock->screen_ptr;
221 --- 3484,3490 ----
225 ! static int
226 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
228 WScreen *scr = dock->screen_ptr;
229 ***************
230 *** 3499,3507 ****
231 int ix = aicon->xindex, iy = aicon->yindex;
232 int tmp;
233 Pixmap ghost = None;
234 ! Bool docked;
235 int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
237 if (wPreferences.flags.noupdates)
238 return;
240 --- 3499,3508 ----
241 int ix = aicon->xindex, iy = aicon->yindex;
242 int tmp;
243 Pixmap ghost = None;
244 ! Bool docked, hasMoved;
245 int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
247 + hasMoved = False;
248 if (wPreferences.flags.noupdates)
249 return;
251 ***************
252 *** 3551,3556 ****
253 --- 3552,3558 ----
254 break;
256 case MotionNotify:
257 + hasMoved = True;
258 if (!grabbed) {
259 if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
260 || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
261 ***************
262 *** 3690,3696 ****
263 #ifdef DEBUG
264 puts("End icon move");
265 #endif
266 ! return;
270 --- 3692,3701 ----
271 #ifdef DEBUG
272 puts("End icon move");
273 #endif
274 ! if (!hasMoved) {
275 ! return 1;
277 ! return 0;
281 ***************
282 *** 3807,3813 ****
283 XUnmapWindow(dpy, scr->clip_balloon);
284 scr->flags.clip_balloon_mapped = 0;
287 #ifdef DEBUG
288 puts("handling dock");
289 #endif
290 --- 3812,3818 ----
291 XUnmapWindow(dpy, scr->clip_balloon);
292 scr->flags.clip_balloon_mapped = 0;
295 #ifdef DEBUG
296 puts("handling dock");
297 #endif
298 ***************
299 *** 3830,3836 ****
300 else
301 handleDockMove(dock, aicon, event);
302 } else
303 ! handleIconMove(dock, aicon, event);
305 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
306 aicon->xindex==0 && aicon->yindex==0) {
307 --- 3835,3843 ----
308 else
309 handleDockMove(dock, aicon, event);
310 } else
311 ! if (handleIconMove(dock, aicon, event) != 0 &&
312 ! wPreferences.single_click)
313 ! iconDblClick(desc, event);
315 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
316 aicon->xindex==0 && aicon->yindex==0) {
317 diff -rc WindowMaker-0.52.0.ori/src/icon.c WindowMaker-0.52.0/src/icon.c
318 *** WindowMaker-0.52.0.ori/src/icon.c Thu Mar 18 17:39:39 1999
319 --- WindowMaker-0.52.0/src/icon.c Wed Apr 14 10:37:02 1999
320 ***************
321 *** 809,814 ****
322 --- 809,815 ----
323 int dx=event->xbutton.x, dy=event->xbutton.y;
324 int grabbed=0;
325 int clickButton=event->xbutton.button;
326 + Bool hasMoved;
328 if (WCHECK_STATE(WSTATE_MODAL))
329 return;
330 ***************
331 *** 851,856 ****
332 --- 852,858 ----
333 wwarning("pointer grab failed for icon move");
334 #endif
336 + hasMoved = False;
337 while(1) {
338 WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
339 |ButtonMotionMask|ExposureMask, &ev);
340 ***************
341 *** 860,865 ****
342 --- 862,868 ----
343 break;
345 case MotionNotify:
346 + hasMoved = True;
347 if (!grabbed) {
348 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
349 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
350 ***************
351 *** 897,902 ****
352 --- 900,908 ----
354 if (wPreferences.auto_arrange_icons)
355 wArrangeIcons(wwin->screen_ptr, True);
356 + if (!hasMoved && wPreferences.single_click) {
357 + miniwindowDblClick(desc, event);
359 return;