mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 05:48:01 +01:00
updated the single click patch to conform with Window Maker 0.65.0's source
code sent by: Daniel Richard G. <skunk@graphics.lcs.mit.edu>
This commit is contained in:
@@ -7,9 +7,12 @@ single_click.diff
|
||||
|
||||
allows single click in dock
|
||||
|
||||
for version: 0.52.0
|
||||
for version: 0.65.0
|
||||
|
||||
author:
|
||||
Sebastien Bauer <seb_bauer@bigfoot.com>
|
||||
John Morrissey <jwm@horde.net>
|
||||
|
||||
updated for Window Maker 0.65.0 by:
|
||||
Daniel Richard G. <skunk@graphics.lcs.mit.edu>
|
||||
|
||||
|
||||
@@ -1,202 +1,179 @@
|
||||
diff -urN WindowMaker-0.62.1/WPrefs.app/Expert.c WindowMaker-0.62.1.patched/WPrefs.app/Expert.c
|
||||
--- WindowMaker-0.62.1/WPrefs.app/Expert.c Fri Sep 17 17:03:54 1999
|
||||
+++ WindowMaker-0.62.1.patched/WPrefs.app/Expert.c Wed Aug 16 20:43:48 2000
|
||||
diff -ur WindowMaker-0.65.0/WPrefs.app/Expert.c WindowMaker-0.65.0.patched/WPrefs.app/Expert.c
|
||||
--- WindowMaker-0.65.0/WPrefs.app/Expert.c Tue May 8 20:34:52 2001
|
||||
+++ WindowMaker-0.65.0.patched/WPrefs.app/Expert.c Mon May 21 04:12:33 2001
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
WMWindow *win;
|
||||
WMWidget *parent;
|
||||
|
||||
- WMButton *swi[8];
|
||||
+ WMButton *swi[9];
|
||||
|
||||
} _Panel;
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
|
||||
WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking"));
|
||||
@@ -54,6 +54,7 @@
|
||||
WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindozeCycling"));
|
||||
WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
|
||||
+ WMSetButtonSelected(panel->swi[6], GetBoolForKey("SingleClickLaunch"));
|
||||
WMSetButtonSelected(panel->swi[6], GetBoolForKey("DisableBlinking"));
|
||||
+ WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +67,7 @@
|
||||
WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
|
||||
WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
|
||||
panel->box = WMCreateBox(panel->parent);
|
||||
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
|
||||
|
||||
- for (i=0; i<6; i++) {
|
||||
+ for (i=0; i<7; i++) {
|
||||
panel->swi[i] = WMCreateSwitchButton(panel->frame);
|
||||
- for (i=0; i<7; i++) {
|
||||
+ for (i=0; i<8; i++) {
|
||||
panel->swi[i] = WMCreateSwitchButton(panel->box);
|
||||
WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
|
||||
WMMoveWidget(panel->swi[i], 20, 20+i*25);
|
||||
@@ -78,6 +79,7 @@
|
||||
WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects"));
|
||||
WMSetButtonText(panel->swi[4], _("Disable cycling color highlighting of icons."));
|
||||
@@ -79,6 +80,7 @@
|
||||
WMSetButtonText(panel->swi[4], _("Use Windoze style cycling."));
|
||||
WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command."));
|
||||
+ WMSetButtonText(panel->swi[6], _("Launch applications and restore windows with a single click"));
|
||||
WMSetButtonText(panel->swi[6], _("Disable cycling of highlighting color for selected icons."));
|
||||
+ WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click"));
|
||||
|
||||
WMRealizeWidget(panel->frame);
|
||||
WMMapSubwidgets(panel->frame);
|
||||
@@ -99,6 +101,7 @@
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking");
|
||||
WMRealizeWidget(panel->box);
|
||||
WMMapSubwidgets(panel->box);
|
||||
@@ -101,6 +103,7 @@
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindozeCycling");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
|
||||
+ SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "SingleClickLaunch");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking");
|
||||
+ SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
|
||||
}
|
||||
|
||||
|
||||
diff -urN WindowMaker-0.62.1/src/WindowMaker.h WindowMaker-0.62.1.patched/src/WindowMaker.h
|
||||
--- WindowMaker-0.62.1/src/WindowMaker.h Tue Mar 28 22:23:38 2000
|
||||
+++ WindowMaker-0.62.1.patched/src/WindowMaker.h Wed Aug 16 20:37:00 2000
|
||||
@@ -416,6 +416,9 @@
|
||||
diff -ur WindowMaker-0.65.0/src/WindowMaker.h WindowMaker-0.65.0.patched/src/WindowMaker.h
|
||||
--- WindowMaker-0.65.0/src/WindowMaker.h Fri Apr 27 19:41:21 2001
|
||||
+++ WindowMaker-0.65.0.patched/src/WindowMaker.h Mon May 21 04:19:10 2001
|
||||
@@ -460,6 +460,9 @@
|
||||
/* shading animation */
|
||||
signed char shade_speed;
|
||||
|
||||
+ /* single click to lauch applications */
|
||||
+ char single_click;
|
||||
+ /* single click to lauch applications */
|
||||
+ char single_click;
|
||||
+
|
||||
int edge_resistance;
|
||||
char attract;
|
||||
|
||||
diff -urN WindowMaker-0.62.1/src/appicon.c WindowMaker-0.62.1.patched/src/appicon.c
|
||||
--- WindowMaker-0.62.1/src/appicon.c Wed Mar 29 21:52:10 2000
|
||||
+++ WindowMaker-0.62.1.patched/src/appicon.c Wed Aug 16 20:37:00 2000
|
||||
@@ -717,6 +717,7 @@
|
||||
diff -ur WindowMaker-0.65.0/src/appicon.c WindowMaker-0.65.0.patched/src/appicon.c
|
||||
--- WindowMaker-0.65.0/src/appicon.c Sat Feb 17 17:46:29 2001
|
||||
+++ WindowMaker-0.65.0.patched/src/appicon.c Mon May 21 04:33:07 2001
|
||||
@@ -704,6 +704,7 @@
|
||||
int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
|
||||
int ix, iy;
|
||||
int clickButton = event->xbutton.button;
|
||||
+ Bool hasMoved;
|
||||
+ Bool hasMoved = False;
|
||||
Pixmap ghost = None;
|
||||
Window wins[2];
|
||||
|
||||
@@ -786,6 +787,7 @@
|
||||
XClearWindow(dpy, scr->dock_shadow);
|
||||
}
|
||||
|
||||
+ hasMoved = False;
|
||||
while (!done) {
|
||||
WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
|
||||
|ButtonMotionMask|ExposureMask, &ev);
|
||||
@@ -795,6 +797,7 @@
|
||||
Bool movingSingle = False;
|
||||
@@ -794,6 +795,7 @@
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
+ hasMoved = True;
|
||||
+ hasMoved = True;
|
||||
if (!grabbed) {
|
||||
if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
|
||||
|| abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
|
||||
@@ -925,6 +928,9 @@
|
||||
@@ -941,6 +943,8 @@
|
||||
|
||||
if (wPreferences.auto_arrange_icons)
|
||||
wArrangeIcons(scr, True);
|
||||
+ if (!hasMoved && wPreferences.single_click)
|
||||
+ iconDblClick(desc, event);
|
||||
|
||||
done = 1;
|
||||
+ if (!hasMoved && wPreferences.single_click) {
|
||||
+ iconDblClick(desc, event);
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff -urN WindowMaker-0.62.1/src/defaults.c WindowMaker-0.62.1.patched/src/defaults.c
|
||||
--- WindowMaker-0.62.1/src/defaults.c Tue Mar 28 22:58:25 2000
|
||||
+++ WindowMaker-0.62.1.patched/src/defaults.c Wed Aug 16 20:37:58 2000
|
||||
@@ -530,6 +530,9 @@
|
||||
diff -ur WindowMaker-0.65.0/src/defaults.c WindowMaker-0.65.0.patched/src/defaults.c
|
||||
--- WindowMaker-0.65.0/src/defaults.c Thu May 10 18:16:49 2001
|
||||
+++ WindowMaker-0.65.0.patched/src/defaults.c Mon May 21 04:21:05 2001
|
||||
@@ -557,6 +557,9 @@
|
||||
{"DisableBlinking", "NO", NULL,
|
||||
&wPreferences.dont_blink, getBool, NULL
|
||||
},
|
||||
+ {"SingleClickLaunch", "NO", NULL,
|
||||
+ &wPreferences.single_click, getBool, NULL
|
||||
+ &wPreferences.single_click, getBool, NULL
|
||||
+ },
|
||||
/* style options */
|
||||
{"MenuStyle", "normal", seMenuStyles,
|
||||
&wPreferences.menu_style, getEnum, setMenuStyle
|
||||
diff -urN WindowMaker-0.62.1/src/dock.c WindowMaker-0.62.1.patched/src/dock.c
|
||||
--- WindowMaker-0.62.1/src/dock.c Wed Mar 29 21:52:10 2000
|
||||
+++ WindowMaker-0.62.1.patched/src/dock.c Wed Aug 16 20:40:15 2000
|
||||
@@ -3750,7 +3750,7 @@
|
||||
diff -ur WindowMaker-0.65.0/src/dock.c WindowMaker-0.65.0.patched/src/dock.c
|
||||
--- WindowMaker-0.65.0/src/dock.c Tue Apr 17 20:26:03 2001
|
||||
+++ WindowMaker-0.65.0.patched/src/dock.c Mon May 21 04:27:19 2001
|
||||
@@ -3689,7 +3689,7 @@
|
||||
|
||||
|
||||
|
||||
-static void
|
||||
+static int
|
||||
+static Bool
|
||||
handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
{
|
||||
WScreen *scr = dock->screen_ptr;
|
||||
@@ -3765,11 +3765,11 @@
|
||||
int ix = aicon->xindex, iy = aicon->yindex;
|
||||
@@ -3705,6 +3705,7 @@
|
||||
int tmp;
|
||||
Pixmap ghost = None;
|
||||
- Bool docked;
|
||||
+ Bool docked, hasMoved;
|
||||
Bool docked;
|
||||
+ Bool hasMoved = False;
|
||||
int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
|
||||
int omnipresent = aicon->omnipresent; /* this must be cached!!! */
|
||||
|
||||
-
|
||||
+ hasMoved = False;
|
||||
if (wPreferences.flags.noupdates)
|
||||
return;
|
||||
|
||||
@@ -3820,6 +3820,7 @@
|
||||
@@ -3759,6 +3760,7 @@
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
+ hasMoved = True;
|
||||
+ hasMoved = True;
|
||||
if (!grabbed) {
|
||||
if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
|
||||
|| abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
|
||||
@@ -3975,7 +3976,10 @@
|
||||
@@ -3914,7 +3916,7 @@
|
||||
#ifdef DEBUG
|
||||
puts("End icon move");
|
||||
#endif
|
||||
- return;
|
||||
+ if (!hasMoved) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+ return hasMoved;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4115,7 +4119,9 @@
|
||||
@@ -4053,8 +4055,11 @@
|
||||
handleClipChangeWorkspace(scr, event);
|
||||
else
|
||||
handleDockMove(dock, aicon, event);
|
||||
} else
|
||||
- } else
|
||||
- handleIconMove(dock, aicon, event);
|
||||
+ if (handleIconMove(dock, aicon, event) != 0 &&
|
||||
+ wPreferences.single_click)
|
||||
+ } 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 -urN WindowMaker-0.62.1/src/icon.c WindowMaker-0.62.1.patched/src/icon.c
|
||||
--- WindowMaker-0.62.1/src/icon.c Thu Jan 20 06:51:44 2000
|
||||
+++ WindowMaker-0.62.1.patched/src/icon.c Wed Aug 16 20:37:00 2000
|
||||
diff -ur WindowMaker-0.65.0/src/icon.c WindowMaker-0.65.0.patched/src/icon.c
|
||||
--- WindowMaker-0.65.0/src/icon.c Sat Apr 21 03:12:32 2001
|
||||
+++ WindowMaker-0.65.0.patched/src/icon.c Mon May 21 04:29:14 2001
|
||||
@@ -874,6 +874,7 @@
|
||||
int dx=event->xbutton.x, dy=event->xbutton.y;
|
||||
int grabbed=0;
|
||||
int clickButton=event->xbutton.button;
|
||||
+ Bool hasMoved;
|
||||
+ Bool hasMoved = False;
|
||||
|
||||
if (WCHECK_STATE(WSTATE_MODAL))
|
||||
return;
|
||||
@@ -916,6 +917,7 @@
|
||||
wwarning("pointer grab failed for icon move");
|
||||
#endif
|
||||
}
|
||||
+ hasMoved = False;
|
||||
while(1) {
|
||||
WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
|
||||
|ButtonMotionMask|ExposureMask, &ev);
|
||||
@@ -925,6 +927,7 @@
|
||||
@@ -925,6 +926,7 @@
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
+ hasMoved = True;
|
||||
+ hasMoved = True;
|
||||
if (!grabbed) {
|
||||
if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
|
||||
|| abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
|
||||
@@ -962,6 +965,9 @@
|
||||
@@ -962,6 +964,9 @@
|
||||
|
||||
if (wPreferences.auto_arrange_icons)
|
||||
wArrangeIcons(wwin->screen_ptr, True);
|
||||
+ if (!hasMoved && wPreferences.single_click) {
|
||||
+ miniwindowDblClick(desc, event);
|
||||
+ }
|
||||
+ if (!hasMoved && wPreferences.single_click)
|
||||
+ miniwindowDblClick(desc, event);
|
||||
+
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user