- Check whether libXft is at least version 2.1.2 else refuse to compile.
[wmaker-crm.git] / contrib / single_click.diff
blob5e528fc2830e40f49b10a1506bfa378d86efafa9
1 diff -urN wm-a/WPrefs.app/Expert.c wm-c/WPrefs.app/Expert.c
2 --- wm-a/WPrefs.app/Expert.c 2003-01-16 18:30:47.000000000 -0500
3 +++ wm-c/WPrefs.app/Expert.c 2003-05-19 12:50:17.000000000 -0400
4 @@ -33,7 +33,7 @@
6 WMWidget *parent;
8 - WMButton *swi[8];
9 + WMButton *swi[9];
11 } _Panel;
13 @@ -54,8 +54,9 @@
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"));
18 if (WMHasAntialiasingSupport(WMWidgetScreen(panel->box)))
19 - WMSetButtonSelected(panel->swi[7], GetBoolForKey("AntialiasedText"));
20 + WMSetButtonSelected(panel->swi[8], GetBoolForKey("AntialiasedText"));
24 @@ -68,10 +69,10 @@
25 panel->box = WMCreateBox(panel->parent);
26 WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
28 - for (i=0; i<8; i++) {
29 + for (i=0; i<9; i++) {
30 panel->swi[i] = WMCreateSwitchButton(panel->box);
31 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
32 - WMMoveWidget(panel->swi[i], 20, 20+i*25);
33 + WMMoveWidget(panel->swi[i], 20, 5+i*25);
36 WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for miniaturized windows). For use with KDE/GNOME."));
37 @@ -81,11 +82,11 @@
38 WMSetButtonText(panel->swi[4], _("Use Windoze style cycling."));
39 WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command."));
40 WMSetButtonText(panel->swi[6], _("Disable selection animation for selected icons."));
41 - WMSetButtonText(panel->swi[7], _("Smooth font edges (needs restart)."));
43 + WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click"));
44 + WMSetButtonText(panel->swi[8], _("Smooth font edges (needs restart)."));
45 if (!WMHasAntialiasingSupport(WMWidgetScreen(panel->box)))
46 - WMSetButtonEnabled(panel->swi[7], False);
48 + WMSetButtonEnabled(panel->swi[8], False);
50 WMRealizeWidget(panel->box);
51 WMMapSubwidgets(panel->box);
53 @@ -107,8 +108,9 @@
54 SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindozeCycling");
55 SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
56 SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking");
57 + SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
58 if (WMHasAntialiasingSupport(WMWidgetScreen(panel->box)))
59 - SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "AntialiasedText");
60 + SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "AntialiasedText");
64 Binary files wm-a/contrib/.single_click.diff.swp and wm-c/contrib/.single_click.diff.swp differ
65 diff -urN wm-a/src/WindowMaker.h wm-c/src/WindowMaker.h
66 --- wm-a/src/WindowMaker.h 2003-01-16 18:30:48.000000000 -0500
67 +++ wm-c/src/WindowMaker.h 2003-05-19 12:27:57.000000000 -0400
68 @@ -464,6 +464,9 @@
69 /* shading animation */
70 signed char shade_speed;
72 + /* single click to lauch applications */
73 + char single_click;
75 int edge_resistance;
76 char attract;
78 diff -urN wm-a/src/appicon.c wm-c/src/appicon.c
79 --- wm-a/src/appicon.c 2003-01-16 18:30:48.000000000 -0500
80 +++ wm-c/src/appicon.c 2003-05-19 12:27:01.000000000 -0400
81 @@ -585,6 +585,7 @@
82 int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
83 int ix, iy;
84 int clickButton = event->xbutton.button;
85 + Bool hasMoved = False;
86 Pixmap ghost = None;
87 Window wins[2];
88 Bool movingSingle = False;
89 @@ -665,6 +666,7 @@
90 break;
92 case MotionNotify:
93 + hasMoved = True;
94 if (!grabbed) {
95 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
96 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
97 @@ -801,7 +803,9 @@
99 if (wPreferences.auto_arrange_icons)
100 wArrangeIcons(scr, True);
103 + if (!hasMoved && wPreferences.single_click)
104 + iconDblClick(desc, event);
105 done = 1;
106 break;
108 diff -urN wm-a/src/defaults.c wm-c/src/defaults.c
109 --- wm-a/src/defaults.c 2003-01-16 18:30:48.000000000 -0500
110 +++ wm-c/src/defaults.c 2003-05-19 12:27:17.000000000 -0400
111 @@ -547,6 +547,9 @@
112 {"DisableBlinking", "NO", NULL,
113 &wPreferences.dont_blink, getBool, NULL
115 + {"SingleClickLaunch", "NO", NULL,
116 + &wPreferences.single_click, getBool, NULL
117 + },
118 /* style options */
119 {"MenuStyle", "normal", seMenuStyles,
120 &wPreferences.menu_style, getEnum, setMenuStyle
121 diff -urN wm-a/src/dock.c wm-c/src/dock.c
122 --- wm-a/src/dock.c 2003-02-28 07:42:17.000000000 -0500
123 +++ wm-c/src/dock.c 2003-05-19 12:27:33.000000000 -0400
124 @@ -3782,7 +3782,7 @@
128 -static void
129 +static Bool
130 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
132 WScreen *scr = dock->screen_ptr;
133 @@ -3798,6 +3798,7 @@
134 int tmp;
135 Pixmap ghost = None;
136 Bool docked;
137 + Bool hasMoved = False;
138 int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
139 int omnipresent = aicon->omnipresent; /* this must be cached!!! */
141 @@ -3852,6 +3853,7 @@
142 break;
144 case MotionNotify:
145 + hasMoved = True;
146 if (!grabbed) {
147 if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
148 || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
149 @@ -4001,7 +4003,7 @@
150 #ifdef DEBUG
151 puts("End icon move");
152 #endif
153 - return;
154 + return hasMoved;
158 @@ -4140,8 +4142,11 @@
159 handleClipChangeWorkspace(scr, event);
160 else
161 handleDockMove(dock, aicon, event);
162 - } else
163 - handleIconMove(dock, aicon, event);
164 + } else {
165 + Bool hasMoved = handleIconMove(dock, aicon, event);
166 + if (!hasMoved && wPreferences.single_click)
167 + iconDblClick(desc, event);
170 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
171 aicon==scr->clip_icon) {
172 diff -urN wm-a/src/icon.c wm-c/src/icon.c
173 --- wm-a/src/icon.c 2003-01-16 18:30:49.000000000 -0500
174 +++ wm-c/src/icon.c 2003-05-19 12:27:44.000000000 -0400
175 @@ -878,7 +878,8 @@
176 int dx=event->xbutton.x, dy=event->xbutton.y;
177 int grabbed=0;
178 int clickButton=event->xbutton.button;
180 + Bool hasMoved = False;
182 if (WCHECK_STATE(WSTATE_MODAL))
183 return;
185 @@ -929,6 +930,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 @@ -966,6 +968,8 @@
195 if (wPreferences.auto_arrange_icons)
196 wArrangeIcons(wwin->screen_ptr, True);
197 + if (!hasMoved && wPreferences.single_click)
198 + miniwindowDblClick(desc, event);
199 return;