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