]> git.pld-linux.org Git - packages/WindowMaker.git/blame - WindowMaker-singleclick.patch
- updated for 0.65.0.
[packages/WindowMaker.git] / WindowMaker-singleclick.patch
CommitLineData
43612bfa
JR
1diff -ur WindowMaker-0.64.0/WPrefs.app/Expert.c WindowMaker-0.64.0.new/WPrefs.app/Expert.c
2--- WindowMaker-0.64.0/WPrefs.app/Expert.c Thu Feb 8 22:54:12 2001
3+++ WindowMaker-0.64.0.new/WPrefs.app/Expert.c Wed Mar 21 20:00:55 2001
4@@ -33,7 +33,7 @@
5
6 WMWidget *parent;
7
8- WMButton *swi[8];
9+ WMButton *swi[9];
10
11 } _Panel;
12
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"));
18 }
19
20
21@@ -66,7 +67,7 @@
22 panel->box = WMCreateBox(panel->parent);
ffba6295 23 WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
43612bfa
JR
24
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 @@
ffba6295 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."));
43612bfa
JR
34+ WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click"));
35
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");
43 }
44
45
46diff -ur WindowMaker-0.64.0/src/WindowMaker.h WindowMaker-0.64.0.new/src/WindowMaker.h
47--- WindowMaker-0.64.0/src/WindowMaker.h Fri Feb 9 16:56:53 2001
48+++ WindowMaker-0.64.0.new/src/WindowMaker.h Wed Mar 21 19:59:08 2001
49@@ -435,6 +435,9 @@
149d7ea9 50 /* shading animation */
dab91712 51 signed char shade_speed;
149d7ea9
JR
52
53+ /* single click to lauch applications */
54+ char single_click;
55+
56 int edge_resistance;
5a1d6215 57 char attract;
149d7ea9 58
43612bfa
JR
59diff -ur WindowMaker-0.64.0/src/appicon.c WindowMaker-0.64.0.new/src/appicon.c
60--- WindowMaker-0.64.0/src/appicon.c Thu Jan 18 20:21:57 2001
61+++ WindowMaker-0.64.0.new/src/appicon.c Wed Mar 21 19:59:08 2001
ffba6295 62@@ -704,6 +704,7 @@
149d7ea9
JR
63 int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
64 int ix, iy;
65 int clickButton = event->xbutton.button;
ffba6295 66+ Bool hasMoved;
149d7ea9
JR
67 Pixmap ghost = None;
68 Window wins[2];
ffba6295 69 Bool movingSingle = False;
70@@ -785,6 +786,7 @@
149d7ea9
JR
71 XClearWindow(dpy, scr->dock_shadow);
72 }
ffba6295 73
74+ hasMoved = False;
149d7ea9
JR
75 while (!done) {
76 WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
77 |ButtonMotionMask|ExposureMask, &ev);
ffba6295 78@@ -794,6 +796,7 @@
149d7ea9
JR
79 break;
80
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) {
ffba6295 86@@ -943,6 +946,9 @@
149d7ea9
JR
87 wArrangeIcons(scr, True);
88
89 done = 1;
90+ if (!hasMoved && wPreferences.single_click) {
91+ iconDblClick(desc, event);
92+ }
93 break;
94 }
95 }
43612bfa
JR
96diff -ur WindowMaker-0.64.0/src/defaults.c WindowMaker-0.64.0.new/src/defaults.c
97--- WindowMaker-0.64.0/src/defaults.c Thu Jan 18 20:21:57 2001
98+++ WindowMaker-0.64.0.new/src/defaults.c Wed Mar 21 19:59:08 2001
260b62b4 99@@ -547,6 +547,9 @@
149d7ea9
JR
100 {"DisableBlinking", "NO", NULL,
101 &wPreferences.dont_blink, getBool, NULL
102 },
dab91712 103+ {"SingleClickLaunch", "NO", NULL,
43612bfa 104+ &wPreferences.single_click, getBool, NULL
dab91712 105+ },
106 /* style options */
107 {"MenuStyle", "normal", seMenuStyles,
108 &wPreferences.menu_style, getEnum, setMenuStyle
43612bfa
JR
109diff -ur WindowMaker-0.64.0/src/dock.c WindowMaker-0.64.0.new/src/dock.c
110--- WindowMaker-0.64.0/src/dock.c Thu Jan 18 02:33:45 2001
111+++ WindowMaker-0.64.0.new/src/dock.c Wed Mar 21 19:59:08 2001
260b62b4 112@@ -3752,7 +3752,7 @@
149d7ea9
JR
113
114
115
116-static void
117+static int
118 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
119 {
120 WScreen *scr = dock->screen_ptr;
43612bfa 121@@ -3767,11 +3767,11 @@
149d7ea9
JR
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!!! */
129
43612bfa 130-
149d7ea9
JR
131+ hasMoved = False;
132 if (wPreferences.flags.noupdates)
133 return;
134
43612bfa 135@@ -3822,6 +3822,7 @@
149d7ea9
JR
136 break;
137
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) {
43612bfa 143@@ -3977,7 +3978,10 @@
149d7ea9
JR
144 #ifdef DEBUG
145 puts("End icon move");
146 #endif
147- return;
148+ if (!hasMoved) {
149+ return 1;
150+ }
151+ return 0;
152 }
153 }
154 }
43612bfa 155@@ -4117,7 +4121,9 @@
149d7ea9
JR
156 else
157 handleDockMove(dock, aicon, event);
158 } else
159- handleIconMove(dock, aicon, event);
43612bfa
JR
160+ if (handleIconMove(dock, aicon, event) != 0 &&
161+ wPreferences.single_click)
162+ iconDblClick(desc, event);
149d7ea9
JR
163
164 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
165 aicon==scr->clip_icon) {
43612bfa
JR
166diff -ur WindowMaker-0.64.0/src/icon.c WindowMaker-0.64.0.new/src/icon.c
167--- WindowMaker-0.64.0/src/icon.c Sat Jan 6 19:54:16 2001
168+++ WindowMaker-0.64.0.new/src/icon.c Wed Mar 21 19:59:08 2001
dab91712 169@@ -874,6 +874,7 @@
149d7ea9
JR
170 int dx=event->xbutton.x, dy=event->xbutton.y;
171 int grabbed=0;
172 int clickButton=event->xbutton.button;
173+ Bool hasMoved;
174
175 if (WCHECK_STATE(WSTATE_MODAL))
176 return;
dab91712 177@@ -916,6 +917,7 @@
149d7ea9
JR
178 wwarning("pointer grab failed for icon move");
179 #endif
180 }
181+ hasMoved = False;
182 while(1) {
183 WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
184 |ButtonMotionMask|ExposureMask, &ev);
dab91712 185@@ -925,6 +927,7 @@
149d7ea9
JR
186 break;
187
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) {
dab91712 193@@ -962,6 +965,9 @@
149d7ea9
JR
194
195 if (wPreferences.auto_arrange_icons)
196 wArrangeIcons(wwin->screen_ptr, True);
197+ if (!hasMoved && wPreferences.single_click) {
198+ miniwindowDblClick(desc, event);
199+ }
200 return;
201
202 }
This page took 0.055794 seconds and 4 git commands to generate.