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