]> git.pld-linux.org Git - packages/WindowMaker.git/blob - WindowMaker-singleclick.patch
- updated for 0.65.0.
[packages/WindowMaker.git] / WindowMaker-singleclick.patch
1 diff -ur WindowMaker-0.64.0/WPrefs.app/Expert.c WindowMaker-0.64.0.new/WPrefs.app/Expert.c
2 --- WindowMaker-0.64.0/WPrefs.app/Expert.c      Thu Feb  8 22:54:12 2001
3 +++ WindowMaker-0.64.0.new/WPrefs.app/Expert.c  Wed Mar 21 20:00:55 2001
4 @@ -33,7 +33,7 @@
5      
6      WMWidget *parent;
7  
8 -    WMButton *swi[8];
9 +    WMButton *swi[9];
10  
11  } _Panel;
12  
13 @@ -54,6 +54,7 @@
14      WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindozeCycling"));
15      WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
16      WMSetButtonSelected(panel->swi[6], GetBoolForKey("DisableBlinking"));
17 +    WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
18  }
19  
20  
21 @@ -66,7 +67,7 @@
22      panel->box = WMCreateBox(panel->parent);
23      WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
24  
25 -    for (i=0; i<7; i++) {
26 +    for (i=0; i<8; i++) {
27         panel->swi[i] = WMCreateSwitchButton(panel->box);
28         WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
29         WMMoveWidget(panel->swi[i], 20, 20+i*25);
30 @@ -79,6 +80,7 @@
31      WMSetButtonText(panel->swi[4], _("Use Windoze style cycling."));
32      WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command."));
33      WMSetButtonText(panel->swi[6], _("Disable cycling of highlighting color for selected icons."));
34 +    WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click"));
35  
36      WMRealizeWidget(panel->box);
37      WMMapSubwidgets(panel->box);
38 @@ -101,6 +103,7 @@
39      SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindozeCycling");
40      SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
41      SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking");
42 +    SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
43  }
44  
45  
46 diff -ur WindowMaker-0.64.0/src/WindowMaker.h WindowMaker-0.64.0.new/src/WindowMaker.h
47 --- WindowMaker-0.64.0/src/WindowMaker.h        Fri Feb  9 16:56:53 2001
48 +++ WindowMaker-0.64.0.new/src/WindowMaker.h    Wed Mar 21 19:59:08 2001
49 @@ -435,6 +435,9 @@
50      /* shading animation */
51      signed char shade_speed;
52  
53 +       /* single click to lauch applications */
54 +       char single_click;
55 +
56      int edge_resistance;
57      char attract;
58  
59 diff -ur WindowMaker-0.64.0/src/appicon.c WindowMaker-0.64.0.new/src/appicon.c
60 --- WindowMaker-0.64.0/src/appicon.c    Thu Jan 18 20:21:57 2001
61 +++ WindowMaker-0.64.0.new/src/appicon.c        Wed Mar 21 19:59:08 2001
62 @@ -704,6 +704,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      Bool movingSingle = False;
70 @@ -785,6 +786,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 @@ -794,6 +796,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 @@ -943,6 +946,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 -ur WindowMaker-0.64.0/src/defaults.c WindowMaker-0.64.0.new/src/defaults.c
97 --- WindowMaker-0.64.0/src/defaults.c   Thu Jan 18 20:21:57 2001
98 +++ WindowMaker-0.64.0.new/src/defaults.c       Wed Mar 21 19:59:08 2001
99 @@ -547,6 +547,9 @@
100      {"DisableBlinking",        "NO",           NULL,
101            &wPreferences.dont_blink,    getBool,        NULL
102      },
103 +    {"SingleClickLaunch", "NO",                NULL,
104 +       &wPreferences.single_click,     getBool,        NULL
105 +    },
106        /* style options */
107      {"MenuStyle",      "normal",               seMenuStyles,
108         &wPreferences.menu_style, getEnum,      setMenuStyle
109 diff -ur WindowMaker-0.64.0/src/dock.c WindowMaker-0.64.0.new/src/dock.c
110 --- WindowMaker-0.64.0/src/dock.c       Thu Jan 18 02:33:45 2001
111 +++ WindowMaker-0.64.0.new/src/dock.c   Wed Mar 21 19:59:08 2001
112 @@ -3752,7 +3752,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 @@ -3767,11 +3767,11 @@
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 @@ -3822,6 +3822,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 @@ -3977,7 +3978,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 @@ -4117,7 +4121,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 -ur WindowMaker-0.64.0/src/icon.c WindowMaker-0.64.0.new/src/icon.c
167 --- WindowMaker-0.64.0/src/icon.c       Sat Jan  6 19:54:16 2001
168 +++ WindowMaker-0.64.0.new/src/icon.c   Wed Mar 21 19:59:08 2001
169 @@ -874,6 +874,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 @@ -916,6 +917,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 @@ -925,6 +927,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 @@ -962,6 +965,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.112872 seconds and 4 git commands to generate.