summaryrefslogtreecommitdiff
blob: 662e4949ee18b1037787a5f3c87c5d786f00fd88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
diff -ur WindowMaker-0.80.0/WPrefs.app/Expert.c WindowMaker-0.80.0fpo1/WPrefs.app/Expert.c
--- WindowMaker-0.80.0/WPrefs.app/Expert.c	Mon May 21 18:11:17 2001
+++ WindowMaker-0.80.0fpo1/WPrefs.app/Expert.c	Sat Jan  5 03:08:10 2002
@@ -33,7 +33,7 @@
     
     WMWidget *parent;
 
-    WMButton *swi[8];
+    WMButton *swi[10];
 
 } _Panel;
 
@@ -54,6 +54,8 @@
     WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindozeCycling"));
     WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
     WMSetButtonSelected(panel->swi[6], GetBoolForKey("DisableBlinking"));
+    WMSetButtonSelected(panel->swi[7], GetBoolForKey("DCMaximize"));
+    WMSetButtonSelected(panel->swi[8], GetBoolForKey("SingleClickLaunch"));
 }
 
 
@@ -66,10 +68,10 @@
     panel->box = WMCreateBox(panel->parent);
     WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
 
-    for (i=0; i<7; i++) {
+    for (i=0; i<9; i++) {
 	panel->swi[i] = WMCreateSwitchButton(panel->box);
 	WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
-	WMMoveWidget(panel->swi[i], 20, 20+i*25);
+	WMMoveWidget(panel->swi[i], 20, 20+i*23);
     }
     
     WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for miniaturized windows). For use with KDE/GNOME."));
@@ -79,6 +81,8 @@
     WMSetButtonText(panel->swi[4], _("Use Windoze style cycling."));
     WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command."));
     WMSetButtonText(panel->swi[6], _("Disable selection animation for selected icons."));
+    WMSetButtonText(panel->swi[7], _("Double click on title bar maximize"));
+    WMSetButtonText(panel->swi[8], _("Launch applications and restore windows with a single click"));
 
     WMRealizeWidget(panel->box);
     WMMapSubwidgets(panel->box);
@@ -101,6 +105,8 @@
     SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindozeCycling");
     SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
     SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking");
+    SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "DCMaximize");
+    SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "SingleClickLaunch");
 }
 
 
diff -ur WindowMaker-0.80.0/src/WindowMaker.h WindowMaker-0.80.0fpo1/src/WindowMaker.h
--- WindowMaker-0.80.0/src/WindowMaker.h	Fri Dec 21 21:38:08 2001
+++ WindowMaker-0.80.0fpo1/src/WindowMaker.h	Sat Jan  5 14:12:14 2002
@@ -463,6 +463,12 @@
     /* shading animation */
     signed char shade_speed;
 
+    /* double click on title bar maximize */
+    char dc_maximize;
+
+    /* single click to lauch applications */
+    char single_click;
+
     int edge_resistance;
     char attract;
 
diff -ur WindowMaker-0.80.0/src/appicon.c WindowMaker-0.80.0fpo1/src/appicon.c
--- WindowMaker-0.80.0/src/appicon.c	Tue Dec 18 03:43:48 2001
+++ WindowMaker-0.80.0fpo1/src/appicon.c	Sat Jan  5 14:12:14 2002
@@ -596,6 +596,7 @@
     int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
     int ix, iy;
     int clickButton = event->xbutton.button;
+    Bool hasMoved = False;
     Pixmap ghost = None;
     Window wins[2];
     Bool movingSingle = False;
@@ -676,6 +677,7 @@
 	    break;
 
 	 case MotionNotify:
+	    hasMoved = True;
 	    if (!grabbed) {
 		if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
 		    || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -812,6 +814,8 @@
 
 	    if (wPreferences.auto_arrange_icons)
 		wArrangeIcons(scr, True);
+	    if (!hasMoved && wPreferences.single_click)
+		iconDblClick(desc, event);
 
 	    done = 1;
 	    break;
diff -ur WindowMaker-0.80.0/src/defaults.c WindowMaker-0.80.0fpo1/src/defaults.c
--- WindowMaker-0.80.0/src/defaults.c	Fri Dec 21 21:38:08 2001
+++ WindowMaker-0.80.0fpo1/src/defaults.c	Sat Jan  5 14:12:14 2002
@@ -548,6 +548,12 @@
     {"DisableBlinking",	"NO",		NULL,
 	   &wPreferences.dont_blink,	getBool,	NULL
     },
+    {"DCMaximize", "NO",		NULL,
+	   &wPreferences.dc_maximize,	getBool,	NULL
+    },
+    {"SingleClickLaunch", "NO",		NULL,
+	   &wPreferences.single_click,	getBool,	NULL
+    },
       /* style options */
     {"MenuStyle", 	"normal",  		seMenuStyles,
 	&wPreferences.menu_style, getEnum, 	setMenuStyle
diff -ur WindowMaker-0.80.0/src/dock.c WindowMaker-0.80.0fpo1/src/dock.c
--- WindowMaker-0.80.0/src/dock.c	Fri Dec 21 21:38:08 2001
+++ WindowMaker-0.80.0fpo1/src/dock.c	Sat Jan  5 14:12:14 2002
@@ -3772,7 +3772,7 @@
 
 
 
-static void
+static Bool
 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
 {
     WScreen *scr = dock->screen_ptr;
@@ -3788,6 +3788,7 @@
     int tmp;
     Pixmap ghost = None;
     Bool docked;
+    Bool hasMoved = False;
     int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
     int omnipresent = aicon->omnipresent; /* this must be cached!!! */
 
@@ -3842,6 +3843,7 @@
 	    break;
 
 	 case MotionNotify:
+	    hasMoved = True;
 	    if (!grabbed) {
 		if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
 		    || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -3991,7 +3993,7 @@
 #ifdef DEBUG
 	    puts("End icon move");
 #endif
-	    return;
+	return hasMoved;
 	}
     }
 }
@@ -4130,8 +4132,11 @@
                 handleClipChangeWorkspace(scr, event);
             else
                 handleDockMove(dock, aicon, event);
-        } else
-	    handleIconMove(dock, aicon, event);
+	} else {
+	    Bool hasMoved = handleIconMove(dock, aicon, event);
+	    if (!hasMoved && wPreferences.single_click)
+	        iconDblClick(desc, event);
+	}
 
     } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
                aicon==scr->clip_icon) {
diff -ur WindowMaker-0.80.0/src/icon.c WindowMaker-0.80.0fpo1/src/icon.c
--- WindowMaker-0.80.0/src/icon.c	Tue Jul 24 06:51:05 2001
+++ WindowMaker-0.80.0fpo1/src/icon.c	Sat Jan  5 14:16:16 2002
@@ -877,6 +877,7 @@
     int dx=event->xbutton.x, dy=event->xbutton.y;
     int grabbed=0;
     int clickButton=event->xbutton.button;
+    Bool hasMoved = False;
 
     if (WCHECK_STATE(WSTATE_MODAL))
 	return;
@@ -928,6 +929,7 @@
 	    break;
 
 	 case MotionNotify:
+	    hasMoved = True;
 	    if (!grabbed) {
 		if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
 		    || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -965,6 +967,9 @@
 
 	    if (wPreferences.auto_arrange_icons)
 		wArrangeIcons(wwin->screen_ptr, True);
+	    if (!hasMoved && wPreferences.single_click)
+		miniwindowDblClick(desc, event);
+
 	    return;
 	    
 	}
diff -ur WindowMaker-0.80.0/src/window.c WindowMaker-0.80.0fpo1/src/window.c
--- WindowMaker-0.80.0/src/window.c	Fri Dec 21 21:38:08 2001
+++ WindowMaker-0.80.0fpo1/src/window.c	Sat Jan  5 14:18:07 2002
@@ -2984,14 +2984,29 @@
 
     if (event->xbutton.button==Button1) {
 	if (event->xbutton.state == 0) {
-	    if (!WFLAGP(wwin, no_shadeable)) {
-		/* shade window */
-		if (wwin->flags.shaded)
-		    wUnshadeWindow(wwin);
-		else
-		    wShadeWindow(wwin);
-	    }
-	} else {
+	    /* check preferences, maximize or shade */
+            if (wPreferences.dc_maximize) {
+		if (!WFLAGP(wwin, no_resizable)) {
+		    /* maximize window */
+		    if (wwin->flags.maximized != 0) {
+		    	wUnmaximizeWindow(wwin);
+                        wwin->flags.maximized = 0;
+                    }
+		    else {
+		    	wMaximizeWindow(wwin, MAX_VERTICAL|MAX_HORIZONTAL);
+                        wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL;
+                    }
+	    	}
+	    } else {
+	        if (!WFLAGP(wwin, no_shadeable)) {
+		    /* shade window */
+		    if (wwin->flags.shaded)
+		        wUnshadeWindow(wwin);
+		    else
+		        wShadeWindow(wwin);
+	        }
+            }
+        } else {
 	    int dir = 0;
 
 	    if (event->xbutton.state & ControlMask)