Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37046735
en ru br
Репозитории ALT
S:0.96.0-alt1
5.1: 0.92.0-alt6
4.1: 0.92.0-alt2
4.0: 0.92.0-alt2
3.0: 0.91.0-alt1
+backports:0.92.0-alt0.M30.1
www.altlinux.org/Changes

Группа :: Графические оболочки/Window Maker
Пакет: WindowMaker

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: WindowMaker-0.92.0-wmcontrib-singleclick.patch
Скачать


 WPrefs.app/Expert.c |    5 ++++-
 src/WindowMaker.h   |    3 +++
 src/appicon.c       |    5 +++++
 src/defaults.c      |    3 +++
 src/dock.c          |   15 +++++++++++----
 src/icon.c          |    4 ++++
 6 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c
index 565be3d..159bf09 100644
--- a/WPrefs.app/Expert.c
+++ b/WPrefs.app/Expert.c
@@ -54,6 +54,7 @@ showData(_Panel *panel)
     WMSetButtonSelected(panel->swi[4], GetBoolForKey("DontConfirmKill"));
     WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
     WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
+    WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
 }
 
 
@@ -66,7 +67,7 @@ createPanel(Panel *p)
     panel->box = WMCreateBox(panel->parent);
     WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
 
-    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);
@@ -79,6 +80,7 @@ createPanel(Panel *p)
     WMSetButtonText(panel->swi[4], _("Disable confirmation panel for the Kill command."));
     WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons."));
     WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
+    WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
 
     WMSetButtonEnabled(panel->swi[6], True);
 
@@ -103,6 +105,7 @@ storeDefaults(_Panel *panel)
     SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DontConfirmKill");
     SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
     SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
+    SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
 }
 
 
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 342e244..a4e2f4e 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -475,6 +475,9 @@ typedef struct WPreferences {
     RImage *swtileImage;
     RImage *swbackImage[9];
 
+    /* single click to lauch applications */
+    char single_click;
+
     struct {
         unsigned int nodock:1;	       /* don't display the dock */
         unsigned int noclip:1;         /* don't display the clip */
diff --git a/src/appicon.c b/src/appicon.c
index c37f7fc..e05897b 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -590,6 +590,7 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
     Bool movingSingle = False;
     int oldX = x;
     int oldY = y;
+    Bool hasMoved = False;
 
     if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
         return;
@@ -665,6 +666,7 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
             break;
 
         case MotionNotify:
+            hasMoved = True;
             if (!grabbed) {
                 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
                     || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -802,6 +804,9 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
             if (wPreferences.auto_arrange_icons)
                 wArrangeIcons(scr, True);
 
+            if (wPreferences.single_click && !hasMoved)
+                iconDblClick(desc, event);
+
             done = 1;
             break;
         }
diff --git a/src/defaults.c b/src/defaults.c
index 0ceecac..bd075df 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -553,6 +553,9 @@ WDefaultEntry optionList[] = {
     {"DisableBlinking",	"NO",		NULL,
     &wPreferences.dont_blink,	getBool,	NULL
     },
+    {"SingleClickLaunch",	"NO",	NULL,
+    &wPreferences.single_click,	getBool,	NULL
+    },
     /* style options */
     {"MenuStyle", 	"normal",  		seMenuStyles,
     &wPreferences.menu_style, getEnum, 	setMenuStyle
diff --git a/src/dock.c b/src/dock.c
index df173a8..04cd32c 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -3758,7 +3758,7 @@ handleDockMove(WDock *dock, WAppIcon *aicon, XEvent *event)
 
 
 
-static void
+static Bool
 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
 {
     WScreen *scr = dock->screen_ptr;
@@ -3776,6 +3776,7 @@ handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
     Bool docked;
     int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
     int omnipresent = aicon->omnipresent; /* this must be cached!!! */
+    Bool hasMoved = False;
 
 
     if (wPreferences.flags.noupdates)
@@ -3828,6 +3829,7 @@ handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
             break;
 
         case MotionNotify:
+            hasMoved = True;
             if (!grabbed) {
                 if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
                     || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -3977,9 +3979,11 @@ handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
 #ifdef DEBUG
             puts("End icon move");
 #endif
-            return;
+            return hasMoved;
         }
     }
+
+    return False;  /* never reached */
 }
 
 
@@ -4116,8 +4120,11 @@ iconMouseDown(WObjDescriptor *desc, XEvent *event)
                 handleClipChangeWorkspace(scr, event);
             else
                 handleDockMove(dock, aicon, event);
-        } else
-            handleIconMove(dock, aicon, event);
+        } else {
+            Bool hasMoved = handleIconMove(dock, aicon, event);
+            if (wPreferences.single_click && !hasMoved)
+                iconDblClick(desc, event);
+        }
 
     } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
                aicon==scr->clip_icon) {
diff --git a/src/icon.c b/src/icon.c
index 19a918c..e87d2f1 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -891,6 +891,7 @@ miniwindowMouseDown(WObjDescriptor *desc, XEvent *event)
     int dx=event->xbutton.x, dy=event->xbutton.y;
     int grabbed=0;
     int clickButton=event->xbutton.button;
+    Bool hasMoved = False;
 
     if (WCHECK_STATE(WSTATE_MODAL))
         return;
@@ -942,6 +943,7 @@ miniwindowMouseDown(WObjDescriptor *desc, XEvent *event)
             break;
 
         case MotionNotify:
+            hasMoved = True;
             if (!grabbed) {
                 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
                     || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -979,6 +981,8 @@ miniwindowMouseDown(WObjDescriptor *desc, XEvent *event)
 
             if (wPreferences.auto_arrange_icons)
                 wArrangeIcons(wwin->screen_ptr, True);
+            if (wPreferences.single_click && !hasMoved)
+                miniwindowDblClick(desc, event);
             return;
 
         }
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin