]> git.pld-linux.org Git - packages/WindowMaker.git/blob - WindowMaker-singleclick.patch
- updated for 0.62.1.
[packages/WindowMaker.git] / WindowMaker-singleclick.patch
1 diff -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
4 @@ -53,6 +53,7 @@
5      WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
6      WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking"));
7      WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
8 +    WMSetButtonSelected(panel->swi[6], GetBoolForKey("SingleClickLaunch"));
9  }
10  
11  
12 @@ -66,7 +67,7 @@
13      WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
14      WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
15  
16 -    for (i=0; i<6; i++) {
17 +    for (i=0; i<7; i++) {
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);
21 @@ -78,6 +79,7 @@
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."));
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"));
26  
27      WMRealizeWidget(panel->frame);
28      WMMapSubwidgets(panel->frame);
29 @@ -99,6 +101,7 @@
30      SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
31      SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking");
32      SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
33 +    SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "SingleClickLaunch");
34  }
35  
36  
37 diff -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 @@
41      /* shading animation */
42      signed char shade_speed;
43  
44 +       /* single click to lauch applications */
45 +       char single_click;
46 +
47      int edge_resistance;
48      char attract;
49  
50 diff -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 @@
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  
61 @@ -786,6 +787,7 @@
62          XClearWindow(dpy, scr->dock_shadow);
63      }
64  
65 +       hasMoved = False;
66      while (!done) {
67         WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
68                     |ButtonMotionMask|ExposureMask, &ev);
69 @@ -795,6 +797,7 @@
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) {
77 @@ -925,6 +928,9 @@
78                 wArrangeIcons(scr, True);
79  
80             done = 1;
81 +               if (!hasMoved && wPreferences.single_click) {
82 +                       iconDblClick(desc, event);
83 +               }
84             break;
85         }
86      }
87 diff -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 @@
91      {"DisableBlinking",        "NO",           NULL,
92            &wPreferences.dont_blink,    getBool,        NULL
93      },
94 +    {"SingleClickLaunch", "NO",                NULL,
95 +          &wPreferences.single_click,  getBool,        NULL
96 +    },
97        /* style options */
98      {"MenuStyle",      "normal",               seMenuStyles,
99         &wPreferences.menu_style, getEnum,      setMenuStyle
100 diff -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 @@
104  
105  
106  
107 -static void
108 +static int
109  handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
110  {
111      WScreen *scr = dock->screen_ptr;
112 @@ -3765,11 +3765,12 @@
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  
126 @@ -3820,6 +3821,7 @@
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) {
134 @@ -3975,7 +3977,10 @@
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  }
146 @@ -4115,7 +4120,9 @@
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) {
157 diff -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 @@
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;
168 @@ -916,6 +917,7 @@
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);
176 @@ -925,6 +927,7 @@
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) {
184 @@ -962,6 +965,9 @@
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.173204 seconds and 4 git commands to generate.