1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

WPrefs: add new mouse actions configuration

This patch is adding GUI configuration for new mouse actions:
-Previous Workspace
-Next Workspace
-Previous Window
-Next Window
-Switch Windows

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
David Maciejak
2014-09-11 07:38:10 +07:00
committed by Carlos R. Mafra
parent f40095ac9e
commit 0d0169a413

View File

@@ -93,9 +93,9 @@ typedef struct _Panel {
static char *modifierNames[8]; static char *modifierNames[8];
static char *buttonActions[4]; static char *buttonActions[8];
static char *wheelActions[2]; static char *wheelActions[3];
#define DELAY(i) ((i)*75+170) #define DELAY(i) ((i)*75+170)
@@ -192,6 +192,14 @@ static int getButtonAction(const char *str)
return 2; return 2;
else if (strcasecmp(str, "SelectWindows") == 0) else if (strcasecmp(str, "SelectWindows") == 0)
return 3; return 3;
else if (strcasecmp(str, "MoveToPrevWorkspace") == 0)
return 4;
else if (strcasecmp(str, "MoveToNextWorkspace") == 0)
return 5;
else if (strcasecmp(str, "MoveToPrevWindow") == 0)
return 6;
else if (strcasecmp(str, "MoveToNextWindow") == 0)
return 7;
else else
return -1; return -1;
@@ -206,6 +214,8 @@ static int getWheelAction(const char *str)
return 0; return 0;
else if (strcasecmp(str, "SwitchWorkspaces") == 0) else if (strcasecmp(str, "SwitchWorkspaces") == 0)
return 1; return 1;
else if (strcasecmp(str, "SwitchWindows") == 0)
return 2;
else else
return -1; return -1;
@@ -805,8 +815,9 @@ static void storeData(_Panel * panel)
char buffer[64]; char buffer[64];
int i; int i;
char *tmp, *p; char *tmp, *p;
static char *button[4] = { "None", "OpenApplicationsMenu", "OpenWindowListMenu", "SelectWindows" }; static char *button[8] = { "None", "OpenApplicationsMenu", "OpenWindowListMenu", "SelectWindows",
static char *wheel[2] = { "None", "SwitchWorkspaces" }; "MoveToPrevWorkspace", "MoveToNextWorkspace", "MoveToPrevWindow", "MoveToNextWindow" };
static char *wheel[3] = { "None", "SwitchWorkspaces", "SwitchWindows" };
WMUserDefaults *udb = WMGetStandardUserDefaults(); WMUserDefaults *udb = WMGetStandardUserDefaults();
if (!WMGetUDBoolForKey(udb, "NoXSetStuff")) { if (!WMGetUDBoolForKey(udb, "NoXSetStuff")) {
@@ -878,9 +889,14 @@ Panel *InitMouseSettings(WMWidget *parent)
buttonActions[1] = wstrdup(_("Applications Menu")); buttonActions[1] = wstrdup(_("Applications Menu"));
buttonActions[2] = wstrdup(_("Window List Menu")); buttonActions[2] = wstrdup(_("Window List Menu"));
buttonActions[3] = wstrdup(_("Select Windows")); buttonActions[3] = wstrdup(_("Select Windows"));
buttonActions[4] = wstrdup(_("Previous Workspace"));
buttonActions[5] = wstrdup(_("Next Workspace"));
buttonActions[6] = wstrdup(_("Previous Window"));
buttonActions[7] = wstrdup(_("Next Window"));
wheelActions[0] = wstrdup(_("None")); wheelActions[0] = wstrdup(_("None"));
wheelActions[1] = wstrdup(_("Switch Workspaces")); wheelActions[1] = wstrdup(_("Switch Workspaces"));
wheelActions[2] = wstrdup(_("Switch Windows"));
panel = wmalloc(sizeof(_Panel)); panel = wmalloc(sizeof(_Panel));