--- WindowMaker-0.61.0/WPrefs.app/Expert.c Sat Sep 18 02:11:58 1999 +++ WindowMaker-0.61.0.singleclick/WPrefs.app/Expert.c Sun Oct 10 16:49:18 1999 @@ -53,6 +53,7 @@ WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders")); WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking")); WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill")); + WMSetButtonSelected(panel->swi[6], GetBoolForKey("SingleClickLaunch")); } @@ -66,7 +67,7 @@ WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT); WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP); - for (i=0; i<6; i++) { + for (i=0; i<7; i++) { panel->swi[i] = WMCreateSwitchButton(panel->frame); 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.")); WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command.")); + WMSetButtonText(panel->swi[6], _("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"); SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill"); + SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "SingleClickLaunch"); } --- WindowMaker-0.61.0/src/WindowMaker.h Fri Sep 17 17:42:07 1999 +++ WindowMaker-0.61.0.singleclick/src/WindowMaker.h Sun Oct 10 16:51:11 1999 @@ -400,6 +400,9 @@ /* shading animation */ char shade_speed; + /* single click to lauch applications */ + char single_click; + int edge_resistance; char attract; --- WindowMaker-0.61.0/src/appicon.c Thu Sep 16 05:22:53 1999 +++ WindowMaker-0.61.0.singleclick/src/appicon.c Sun Oct 10 16:51:11 1999 @@ -739,6 +739,7 @@ int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0; int ix, iy; int clickButton = event->xbutton.button; + Bool hasMoved; Pixmap ghost = None; Window wins[2]; @@ -800,6 +801,7 @@ XClearWindow(dpy, scr->dock_shadow); } + hasMoved = False; while (!done) { WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask |ButtonMotionMask|ExposureMask, &ev); @@ -809,6 +811,7 @@ break; case MotionNotify: + hasMoved = True; if (!grabbed) { if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) { @@ -935,6 +938,9 @@ wArrangeIcons(scr, True); done = 1; + if (!hasMoved && wPreferences.single_click) { + iconDblClick(desc, event); + } break; } } --- WindowMaker-0.61.0/src/defaults.c Fri Sep 17 17:42:09 1999 +++ WindowMaker-0.61.0.singleclick/src/defaults.c Sun Oct 10 16:51:11 1999 @@ -503,6 +503,9 @@ {"DisableBlinking", "NO", NULL, &wPreferences.dont_blink, getBool, NULL }, + {"SingleClickLaunch", "NO", NULL, + &wPreferences.single_click, getBool, NULL + }, #ifdef WEENDOZE_CYCLE {"WindozeCycling","NO", NULL, &wPreferences.windoze_cycling, getBool, NULL --- WindowMaker-0.61.0/src/dock.c Thu Sep 16 05:22:53 1999 +++ WindowMaker-0.61.0.singleclick/src/dock.c Sun Oct 10 16:51:11 1999 @@ -3806,7 +3806,7 @@ -static void +static int handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event) { WScreen *scr = dock->screen_ptr; @@ -3821,11 +3821,12 @@ int ix = aicon->xindex, iy = aicon->yindex; int tmp; Pixmap ghost = None; - Bool docked; + Bool docked, hasMoved; 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; @@ -3876,6 +3877,7 @@ break; case MotionNotify: + hasMoved = True; if (!grabbed) { if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) { @@ -4018,7 +4020,10 @@ #ifdef DEBUG puts("End icon move"); #endif - return; + if (!hasMoved) { + return 1; + } + return 0; } } } @@ -4158,7 +4163,9 @@ else handleDockMove(dock, aicon, event); } else - handleIconMove(dock, aicon, event); + if (handleIconMove(dock, aicon, event) != 0 && + wPreferences.single_click) + iconDblClick(desc, event); } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP && aicon==scr->clip_icon) { --- WindowMaker-0.61.0/src/icon.c Sun May 30 07:02:56 1999 +++ WindowMaker-0.61.0.singleclick/src/icon.c Sun Oct 10 16:51:11 1999 @@ -863,6 +863,7 @@ int dx=event->xbutton.x, dy=event->xbutton.y; int grabbed=0; int clickButton=event->xbutton.button; + Bool hasMoved; if (WCHECK_STATE(WSTATE_MODAL)) return; @@ -905,6 +906,7 @@ wwarning("pointer grab failed for icon move"); #endif } + hasMoved = False; while(1) { WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask |ButtonMotionMask|ExposureMask, &ev); @@ -914,6 +916,7 @@ break; case MotionNotify: + hasMoved = True; if (!grabbed) { if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) { @@ -951,6 +954,9 @@ if (wPreferences.auto_arrange_icons) wArrangeIcons(wwin->screen_ptr, True); + if (!hasMoved && wPreferences.single_click) { + miniwindowDblClick(desc, event); + } return; }