]> git.pld-linux.org Git - packages/WindowMaker.git/blob - WindowMaker-singleclick.patch
single click, settable via WMPrefs
[packages/WindowMaker.git] / WindowMaker-singleclick.patch
1 diff -urN WindowMaker-0.60.0.orig/WPrefs.app/Expert.c WindowMaker-0.60.0/WPrefs.app/Expert.c
2 --- WindowMaker-0.60.0.orig/WPrefs.app/Expert.c Sun Apr 25 21:47:28 1999
3 +++ WindowMaker-0.60.0/WPrefs.app/Expert.c      Sun Jul 11 01:29:12 1999
4 @@ -33,7 +33,7 @@
5      
6      WMWindow *win;
7  
8 -    WMButton *swi[5];
9 +    WMButton *swi[6];
10  
11  } _Panel;
12  
13 @@ -52,6 +52,7 @@
14      WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit"));
15      WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
16      WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking"));
17 +    WMSetButtonSelected(panel->swi[5], GetBoolForKey("SingleClickLaunch"));
18  }
19  
20  
21 @@ -65,7 +66,7 @@
22      WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
23      WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
24  
25 -    for (i=0; i<5; i++) {
26 +    for (i=0; i<6; i++) {
27         panel->swi[i] = WMCreateSwitchButton(panel->frame);
28         WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
29         WMMoveWidget(panel->swi[i], 20, 20+i*25);
30 @@ -76,6 +77,7 @@
31      WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker"));
32      WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects"));
33      WMSetButtonText(panel->swi[4], _("Disable cycling color highlighting of icons."));
34 +    WMSetButtonText(panel->swi[5], _("Launch applications and restore windows with a single click"));
35  
36      WMRealizeWidget(panel->frame);
37      WMMapSubwidgets(panel->frame);
38 @@ -96,6 +98,7 @@
39      SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
40      SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
41      SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking");
42 +    SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "SingleClickLaunch");
43  }
44  
45  
46 diff -urN WindowMaker-0.60.0.orig/src/WindowMaker.h WindowMaker-0.60.0/src/WindowMaker.h
47 --- WindowMaker-0.60.0.orig/src/WindowMaker.h   Sun May 30 23:25:20 1999
48 +++ WindowMaker-0.60.0/src/WindowMaker.h        Sun Jul 11 01:29:12 1999
49 @@ -409,6 +409,9 @@
50      /* shading animation */
51      char shade_speed;
52  
53 +       /* single click to lauch applications */
54 +       char single_click;
55 +
56      int edge_resistance;
57  
58      struct {
59 diff -urN WindowMaker-0.60.0.orig/src/appicon.c WindowMaker-0.60.0/src/appicon.c
60 --- WindowMaker-0.60.0.orig/src/appicon.c       Tue Jun  1 12:34:40 1999
61 +++ WindowMaker-0.60.0/src/appicon.c    Sun Jul 11 01:29:12 1999
62 @@ -737,6 +737,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;
67      Pixmap ghost = None;
68      Window wins[2];
69  
70 @@ -798,6 +799,7 @@
71          XClearWindow(dpy, scr->dock_shadow);
72      }
73  
74 +       hasMoved = False;
75      while (!done) {
76         WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
77                     |ButtonMotionMask|ExposureMask, &ev);
78 @@ -807,6 +809,7 @@
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) {
86 @@ -933,6 +936,9 @@
87                 wArrangeIcons(scr, True);
88  
89             done = 1;
90 +               if (!hasMoved && wPreferences.single_click) {
91 +                       iconDblClick(desc, event);
92 +               }
93             break;
94         }
95      }
96 diff -urN WindowMaker-0.60.0.orig/src/defaults.c WindowMaker-0.60.0/src/defaults.c
97 --- WindowMaker-0.60.0.orig/src/defaults.c      Tue Jun  1 12:34:40 1999
98 +++ WindowMaker-0.60.0/src/defaults.c   Sun Jul 11 01:29:12 1999
99 @@ -495,6 +495,9 @@
100      {"DisableBlinking",        "NO",           NULL,
101            &wPreferences.dont_blink,    getBool,        NULL
102      },
103 +       {"SingleClickLaunch", "NO",             NULL,
104 +          &wPreferences.single_click,  getBool,        NULL
105 +       },
106  #ifdef WEENDOZE_CYCLE
107      {"WindozeCycling","NO",                    NULL,
108             &wPreferences.windoze_cycling,      getBool, NULL
109 diff -urN WindowMaker-0.60.0.orig/src/dock.c WindowMaker-0.60.0/src/dock.c
110 --- WindowMaker-0.60.0.orig/src/dock.c  Thu Jun  3 13:29:05 1999
111 +++ WindowMaker-0.60.0/src/dock.c       Sun Jul 11 01:34:50 1999
112 @@ -3746,7 +3746,7 @@
113  
114  
115  
116 -static void
117 +static int
118  handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
119  {
120      WScreen *scr = dock->screen_ptr;
121 @@ -3761,11 +3761,12 @@
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  
130  
131 +    hasMoved = False;
132      if (wPreferences.flags.noupdates)
133         return;
134  
135 @@ -3816,6 +3817,7 @@
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) {
143 @@ -3958,7 +3960,10 @@
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  }
155 @@ -4098,7 +4103,9 @@
156              else
157                  handleDockMove(dock, aicon, event);
158          } else
159 -           handleIconMove(dock, aicon, event);
160 +           if (handleIconMove(dock, aicon, event) != 0 &&
161 +                               wPreferences.single_click)
162 +               iconDblClick(desc, event);
163  
164      } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
165                 aicon==scr->clip_icon) {
166 diff -urN WindowMaker-0.60.0.orig/src/icon.c WindowMaker-0.60.0/src/icon.c
167 --- WindowMaker-0.60.0.orig/src/icon.c  Sun May 30 23:25:21 1999
168 +++ WindowMaker-0.60.0/src/icon.c       Sun Jul 11 01:29:13 1999
169 @@ -863,6 +863,7 @@
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;
177 @@ -905,6 +906,7 @@
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);
185 @@ -914,6 +916,7 @@
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) {
193 @@ -951,6 +954,9 @@
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.049731 seconds and 4 git commands to generate.