wrong change. reversing. =)
[wmaker-crm.git] / contrib / single_click.diff
blob8ced8164a7d567d55db9d56fef91974a31308402
1 diff -ur WindowMaker-0.65.0/WPrefs.app/Expert.c WindowMaker-0.65.0.patched/WPrefs.app/Expert.c
2 --- WindowMaker-0.65.0/WPrefs.app/Expert.c Tue May 8 20:34:52 2001
3 +++ WindowMaker-0.65.0.patched/WPrefs.app/Expert.c Mon May 21 04:12:33 2001
4 @@ -33,7 +33,7 @@
6 WMWidget *parent;
8 - WMButton *swi[8];
9 + WMButton *swi[9];
11 } _Panel;
13 @@ -54,6 +54,7 @@
14 WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindozeCycling"));
15 WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
16 WMSetButtonSelected(panel->swi[6], GetBoolForKey("DisableBlinking"));
17 + WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
21 @@ -66,7 +67,7 @@
22 panel->box = WMCreateBox(panel->parent);
23 WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
25 - for (i=0; i<7; i++) {
26 + for (i=0; i<8; i++) {
27 panel->swi[i] = WMCreateSwitchButton(panel->box);
28 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
29 WMMoveWidget(panel->swi[i], 20, 20+i*25);
30 @@ -79,6 +80,7 @@
31 WMSetButtonText(panel->swi[4], _("Use Windoze style cycling."));
32 WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command."));
33 WMSetButtonText(panel->swi[6], _("Disable cycling of highlighting color for selected icons."));
34 + WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click"));
36 WMRealizeWidget(panel->box);
37 WMMapSubwidgets(panel->box);
38 @@ -101,6 +103,7 @@
39 SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindozeCycling");
40 SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
41 SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking");
42 + SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
46 diff -ur WindowMaker-0.65.0/src/WindowMaker.h WindowMaker-0.65.0.patched/src/WindowMaker.h
47 --- WindowMaker-0.65.0/src/WindowMaker.h Fri Apr 27 19:41:21 2001
48 +++ WindowMaker-0.65.0.patched/src/WindowMaker.h Mon May 21 04:19:10 2001
49 @@ -460,6 +460,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 -ur WindowMaker-0.65.0/src/appicon.c WindowMaker-0.65.0.patched/src/appicon.c
60 --- WindowMaker-0.65.0/src/appicon.c Sat Feb 17 17:46:29 2001
61 +++ WindowMaker-0.65.0.patched/src/appicon.c Mon May 21 04:33:07 2001
62 @@ -704,6 +704,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 = False;
67 Pixmap ghost = None;
68 Window wins[2];
69 Bool movingSingle = False;
70 @@ -794,6 +795,7 @@
71 break;
73 case MotionNotify:
74 + hasMoved = True;
75 if (!grabbed) {
76 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
77 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
78 @@ -941,6 +943,8 @@
80 if (wPreferences.auto_arrange_icons)
81 wArrangeIcons(scr, True);
82 + if (!hasMoved && wPreferences.single_click)
83 + iconDblClick(desc, event);
85 done = 1;
86 break;
87 diff -ur WindowMaker-0.65.0/src/defaults.c WindowMaker-0.65.0.patched/src/defaults.c
88 --- WindowMaker-0.65.0/src/defaults.c Thu May 10 18:16:49 2001
89 +++ WindowMaker-0.65.0.patched/src/defaults.c Mon May 21 04:21:05 2001
90 @@ -557,6 +557,9 @@
91 {"DisableBlinking", "NO", NULL,
92 &wPreferences.dont_blink, getBool, NULL
94 + {"SingleClickLaunch", "NO", NULL,
95 + &wPreferences.single_click, getBool, NULL
96 + },
97 /* style options */
98 {"MenuStyle", "normal", seMenuStyles,
99 &wPreferences.menu_style, getEnum, setMenuStyle
100 diff -ur WindowMaker-0.65.0/src/dock.c WindowMaker-0.65.0.patched/src/dock.c
101 --- WindowMaker-0.65.0/src/dock.c Tue Apr 17 20:26:03 2001
102 +++ WindowMaker-0.65.0.patched/src/dock.c Mon May 21 04:27:19 2001
103 @@ -3689,7 +3689,7 @@
107 -static void
108 +static Bool
109 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
111 WScreen *scr = dock->screen_ptr;
112 @@ -3705,6 +3705,7 @@
113 int tmp;
114 Pixmap ghost = None;
115 Bool docked;
116 + Bool hasMoved = False;
117 int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
118 int omnipresent = aicon->omnipresent; /* this must be cached!!! */
120 @@ -3759,6 +3760,7 @@
121 break;
123 case MotionNotify:
124 + hasMoved = True;
125 if (!grabbed) {
126 if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
127 || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
128 @@ -3914,7 +3916,7 @@
129 #ifdef DEBUG
130 puts("End icon move");
131 #endif
132 - return;
133 + return hasMoved;
137 @@ -4053,8 +4055,11 @@
138 handleClipChangeWorkspace(scr, event);
139 else
140 handleDockMove(dock, aicon, event);
141 - } else
142 - handleIconMove(dock, aicon, event);
143 + } else {
144 + Bool hasMoved = handleIconMove(dock, aicon, event);
145 + if (!hasMoved && wPreferences.single_click)
146 + iconDblClick(desc, event);
149 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
150 aicon==scr->clip_icon) {
151 diff -ur WindowMaker-0.65.0/src/icon.c WindowMaker-0.65.0.patched/src/icon.c
152 --- WindowMaker-0.65.0/src/icon.c Sat Apr 21 03:12:32 2001
153 +++ WindowMaker-0.65.0.patched/src/icon.c Mon May 21 04:29:14 2001
154 @@ -874,6 +874,7 @@
155 int dx=event->xbutton.x, dy=event->xbutton.y;
156 int grabbed=0;
157 int clickButton=event->xbutton.button;
158 + Bool hasMoved = False;
160 if (WCHECK_STATE(WSTATE_MODAL))
161 return;
162 @@ -925,6 +926,7 @@
163 break;
165 case MotionNotify:
166 + hasMoved = True;
167 if (!grabbed) {
168 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
169 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
170 @@ -962,6 +964,9 @@
172 if (wPreferences.auto_arrange_icons)
173 wArrangeIcons(wwin->screen_ptr, True);
174 + if (!hasMoved && wPreferences.single_click)
175 + miniwindowDblClick(desc, event);
177 return;