From 149d7ea90c5d32af638460a2ea8570ac3d3cf05b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 11 Jul 1999 22:26:47 +0000 Subject: [PATCH] single click, settable via WMPrefs Changed files: WindowMaker-singleclick.patch -> 1.1 --- WindowMaker-singleclick.patch | 202 ++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 WindowMaker-singleclick.patch diff --git a/WindowMaker-singleclick.patch b/WindowMaker-singleclick.patch new file mode 100644 index 0000000..5928633 --- /dev/null +++ b/WindowMaker-singleclick.patch @@ -0,0 +1,202 @@ +diff -urN WindowMaker-0.60.0.orig/WPrefs.app/Expert.c WindowMaker-0.60.0/WPrefs.app/Expert.c +--- WindowMaker-0.60.0.orig/WPrefs.app/Expert.c Sun Apr 25 21:47:28 1999 ++++ WindowMaker-0.60.0/WPrefs.app/Expert.c Sun Jul 11 01:29:12 1999 +@@ -33,7 +33,7 @@ + + WMWindow *win; + +- WMButton *swi[5]; ++ WMButton *swi[6]; + + } _Panel; + +@@ -52,6 +52,7 @@ + WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit")); + WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders")); + WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking")); ++ WMSetButtonSelected(panel->swi[5], GetBoolForKey("SingleClickLaunch")); + } + + +@@ -65,7 +66,7 @@ + WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT); + WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP); + +- for (i=0; i<5; i++) { ++ for (i=0; i<6; i++) { + panel->swi[i] = WMCreateSwitchButton(panel->frame); + WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25); + WMMoveWidget(panel->swi[i], 20, 20+i*25); +@@ -76,6 +77,7 @@ + WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker")); + 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], _("Launch applications and restore windows with a single click")); + + WMRealizeWidget(panel->frame); + WMMapSubwidgets(panel->frame); +@@ -96,6 +98,7 @@ + SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit"); + SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders"); + SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking"); ++ SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "SingleClickLaunch"); + } + + +diff -urN WindowMaker-0.60.0.orig/src/WindowMaker.h WindowMaker-0.60.0/src/WindowMaker.h +--- WindowMaker-0.60.0.orig/src/WindowMaker.h Sun May 30 23:25:20 1999 ++++ WindowMaker-0.60.0/src/WindowMaker.h Sun Jul 11 01:29:12 1999 +@@ -409,6 +409,9 @@ + /* shading animation */ + char shade_speed; + ++ /* single click to lauch applications */ ++ char single_click; ++ + int edge_resistance; + + struct { +diff -urN WindowMaker-0.60.0.orig/src/appicon.c WindowMaker-0.60.0/src/appicon.c +--- WindowMaker-0.60.0.orig/src/appicon.c Tue Jun 1 12:34:40 1999 ++++ WindowMaker-0.60.0/src/appicon.c Sun Jul 11 01:29:12 1999 +@@ -737,6 +737,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]; + +@@ -798,6 +799,7 @@ + XClearWindow(dpy, scr->dock_shadow); + } + ++ hasMoved = False; + while (!done) { + WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask + |ButtonMotionMask|ExposureMask, &ev); +@@ -807,6 +809,7 @@ + break; + + case MotionNotify: ++ hasMoved = True; + if (!grabbed) { + if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD + || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) { +@@ -933,6 +936,9 @@ + wArrangeIcons(scr, True); + + done = 1; ++ if (!hasMoved && wPreferences.single_click) { ++ iconDblClick(desc, event); ++ } + break; + } + } +diff -urN WindowMaker-0.60.0.orig/src/defaults.c WindowMaker-0.60.0/src/defaults.c +--- WindowMaker-0.60.0.orig/src/defaults.c Tue Jun 1 12:34:40 1999 ++++ WindowMaker-0.60.0/src/defaults.c Sun Jul 11 01:29:12 1999 +@@ -495,6 +495,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 +diff -urN WindowMaker-0.60.0.orig/src/dock.c WindowMaker-0.60.0/src/dock.c +--- WindowMaker-0.60.0.orig/src/dock.c Thu Jun 3 13:29:05 1999 ++++ WindowMaker-0.60.0/src/dock.c Sun Jul 11 01:34:50 1999 +@@ -3746,7 +3746,7 @@ + + + +-static void ++static int + handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event) + { + WScreen *scr = dock->screen_ptr; +@@ -3761,11 +3761,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; + +@@ -3816,6 +3817,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) { +@@ -3958,7 +3960,10 @@ + #ifdef DEBUG + puts("End icon move"); + #endif +- return; ++ if (!hasMoved) { ++ return 1; ++ } ++ return 0; + } + } + } +@@ -4098,7 +4103,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) { +diff -urN WindowMaker-0.60.0.orig/src/icon.c WindowMaker-0.60.0/src/icon.c +--- WindowMaker-0.60.0.orig/src/icon.c Sun May 30 23:25:21 1999 ++++ WindowMaker-0.60.0/src/icon.c Sun Jul 11 01:29:13 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; + + } -- 2.44.0