mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
- Removed the following 3 options from configuration: SelectWindowsMouseButton,
WindowListMouseButton and ApplicationMenuMouseButton. - Added 4 options to the configuration file for binding workspace actions to mouse buttons: MouseLeftButtonAction, MouseMiddleButtonAction, MouseRightButtonAction and MouseWheelAction. They replace the above 3 removed options, but use a different semantic. - mouse wheel action is runtime configurable now. Read details about this in NEWS.
This commit is contained in:
@@ -47,6 +47,12 @@ Changes since version 0.64.0:
|
||||
a need to restart as until now).
|
||||
- Fixed a bug in the icon chooser dialog that made the selected icon look
|
||||
wrong if it had alpha blending.
|
||||
- Removed the following 3 options from configuration: SelectWindowsMouseButton,
|
||||
WindowListMouseButton and ApplicationMenuMouseButton.
|
||||
- Added 4 options to the configuration file for binding workspace actions to
|
||||
mouse buttons: MouseLeftButtonAction, MouseMiddleButtonAction,
|
||||
MouseRightButtonAction and MouseWheelAction. They replace the above 3
|
||||
removed options, but use a different semantic. More in NEWS.
|
||||
|
||||
|
||||
Changes since version 0.63.1:
|
||||
|
||||
45
NEWS
45
NEWS
@@ -10,6 +10,51 @@ Single AppIcon
|
||||
Removed --single-appicon patch and replaced it with a application
|
||||
specific collapsing option. Check inspector panel and appicon menu.
|
||||
|
||||
New options to configure the workspace mouse actions
|
||||
----------------------------------------------------
|
||||
|
||||
The following options were removed from the WindowMaker defaults configuration
|
||||
file:
|
||||
|
||||
SelectWindowsMouseButton, WindowListMouseButton and ApplicationMenuMouseButton.
|
||||
|
||||
They were replaced with the following 3+1:
|
||||
|
||||
MouseLeftButtonAction, MouseMiddleButtonAction and MouseRightButtonAction plus
|
||||
MouseWheelAction
|
||||
|
||||
In the old way because all gravitated around the workspace actions to which
|
||||
specific mouse buttons could have been bound, it allowed one to specify in
|
||||
the configuration file settings which would have led to weird situations
|
||||
that also had undesirable results.
|
||||
For example the same mouse button (for example left) could have been
|
||||
assigned to all workspace actions: 'select windows', 'show window list menu'
|
||||
and 'show applications menu' which of course were not only impossible to
|
||||
accomplish while still having a properly working workspace, but they also
|
||||
allowed one to specify some settings in the configuration file that were
|
||||
never in fact translatable to proper workspace actions.
|
||||
|
||||
To void this kind of user interface inconsistency, the new options now
|
||||
gravitate around the physical device (the mouse and its buttons) to which
|
||||
specific workspace actions can be bound. This way, even if one assigns the
|
||||
same action to all mouse buttons, that situation while gives redundant and
|
||||
unpractical settings it will still translatable to proper workspace actions:
|
||||
all buttons will execute the same action, but a button will execute only one
|
||||
action at a time.
|
||||
|
||||
The new options take the following values:
|
||||
all Mouse...ButtonAction can have one of the following values:
|
||||
|
||||
None, SelectWindows, OpenApplicationsMenu or OpenWindowListMenu
|
||||
|
||||
MouseWheelAction can be one of None or SwitchWorkspaces
|
||||
|
||||
If you had the default actions bound to mouse buttons before, then it will
|
||||
work for you without any intervention in the configuration files.
|
||||
Else you need to use WPrefs.app to bind the actions to the mouse buttons
|
||||
again to your old settings. Also if you want to change the mouse wheel
|
||||
behavior regarding workspaces you can now (use WPrefs.app to do this).
|
||||
|
||||
|
||||
--- 0.64.0
|
||||
|
||||
|
||||
@@ -63,12 +63,14 @@ typedef struct _Panel {
|
||||
DoubleTest *tester;
|
||||
|
||||
WMFrame *menuF;
|
||||
WMLabel *listL;
|
||||
WMLabel *appL;
|
||||
WMLabel *selL;
|
||||
WMPopUpButton *listP;
|
||||
WMPopUpButton *appP;
|
||||
WMPopUpButton *selP;
|
||||
WMLabel *button1L;
|
||||
WMLabel *button2L;
|
||||
WMLabel *button3L;
|
||||
WMLabel *wheelL;
|
||||
WMPopUpButton *button1P;
|
||||
WMPopUpButton *button2P;
|
||||
WMPopUpButton *button3P;
|
||||
WMPopUpButton *wheelP;
|
||||
|
||||
WMButton *disaB;
|
||||
|
||||
@@ -97,7 +99,9 @@ typedef struct _Panel {
|
||||
static char *modifierNames[8];
|
||||
|
||||
|
||||
static char *buttonNames[6];
|
||||
static char *buttonActions[4];
|
||||
|
||||
static char *wheelActions[2];
|
||||
|
||||
|
||||
#define DELAY(i) ((i)*75+170)
|
||||
@@ -194,32 +198,37 @@ doubleClick(WMWidget *w, void *data)
|
||||
|
||||
|
||||
int
|
||||
getbutton(char *str)
|
||||
getButtonAction(char *str)
|
||||
{
|
||||
if (!str)
|
||||
return -2;
|
||||
|
||||
if (strcasecmp(str, "none")==0)
|
||||
if (strcasecmp(str, "None")==0)
|
||||
return 0;
|
||||
else if (strcasecmp(str, "left")==0)
|
||||
else if (strcasecmp(str, "OpenApplicationsMenu")==0)
|
||||
return 1;
|
||||
else if (strcasecmp(str, "middle")==0)
|
||||
else if (strcasecmp(str, "OpenWindowListMenu")==0)
|
||||
return 2;
|
||||
else if (strcasecmp(str, "right")==0)
|
||||
else if (strcasecmp(str, "SelectWindows")==0)
|
||||
return 3;
|
||||
else if (strcasecmp(str, "button1")==0)
|
||||
return 1;
|
||||
else if (strcasecmp(str, "button2")==0)
|
||||
return 2;
|
||||
else if (strcasecmp(str, "button3")==0)
|
||||
return 3;
|
||||
else if (strcasecmp(str, "button4")==0)
|
||||
return 4;
|
||||
else if (strcasecmp(str, "button5")==0) {
|
||||
return 5;
|
||||
} else {
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getWheelAction(char *str)
|
||||
{
|
||||
if (!str)
|
||||
return -2;
|
||||
|
||||
if (strcasecmp(str, "None")==0)
|
||||
return 0;
|
||||
else if (strcasecmp(str, "SwitchWorkspaces")==0)
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -240,52 +249,58 @@ showData(_Panel *panel)
|
||||
{
|
||||
char *str;
|
||||
int i;
|
||||
int a=-1, b=-1, c=-1;
|
||||
int a=-1, b=-1, c=-1, w=-1;
|
||||
float accel;
|
||||
char buffer[32];
|
||||
Display *dpy = WMScreenDisplay(WMWidgetScreen(panel->parent));
|
||||
|
||||
str = GetStringForKey("SelectWindowsMouseButton");
|
||||
if (str) {
|
||||
i = getbutton(str);
|
||||
str = GetStringForKey("MouseLeftButtonAction");
|
||||
i = getButtonAction(str);
|
||||
if (i<0) {
|
||||
a = 3;
|
||||
if (i==-1) {
|
||||
a = 1;
|
||||
wwarning(_("bad value %s for option %s"),str, "SelectWindowsMouseButton");
|
||||
} else if (i>=0) {
|
||||
wwarning(_("bad value %s for option %s"), str, "MouseLeftButtonAction");
|
||||
}
|
||||
} else {
|
||||
a = i;
|
||||
}
|
||||
} else {
|
||||
a = 0;
|
||||
}
|
||||
WMSetPopUpButtonSelectedItem(panel->selP, a);
|
||||
WMSetPopUpButtonSelectedItem(panel->button1P, a);
|
||||
|
||||
str = GetStringForKey("WindowListMouseButton");
|
||||
if (str) {
|
||||
i = getbutton(str);
|
||||
if (i==-1) {
|
||||
str = GetStringForKey("MouseMiddleButtonAction");
|
||||
i = getButtonAction(str);
|
||||
if (i<0) {
|
||||
b = 2;
|
||||
wwarning(_("bad value %s for option %s"), str, "WindowListMouseButton");
|
||||
} else if (i>=0) {
|
||||
if (i==-1) {
|
||||
wwarning(_("bad value %s for option %s"), str, "MouseMiddleButtonAction");
|
||||
}
|
||||
} else {
|
||||
b = i;
|
||||
}
|
||||
} else {
|
||||
b = 0;
|
||||
}
|
||||
WMSetPopUpButtonSelectedItem(panel->listP, b);
|
||||
WMSetPopUpButtonSelectedItem(panel->button2P, b);
|
||||
|
||||
str = GetStringForKey("ApplicationMenuMouseButton");
|
||||
if (str) {
|
||||
i = getbutton(str);
|
||||
str = GetStringForKey("MouseRightButtonAction");
|
||||
i = getButtonAction(str);
|
||||
if (i<0) {
|
||||
c = 1;
|
||||
if (i==-1) {
|
||||
c = 3;
|
||||
wwarning(_("bad value %s for option %s"), str, "ApplicationMenuMouseButton");
|
||||
} else if (i>=0) {
|
||||
wwarning(_("bad value %s for option %s"), str, "MouseRightButtonAction");
|
||||
}
|
||||
} else {
|
||||
c = i;
|
||||
}
|
||||
} else {
|
||||
c = 0;
|
||||
WMSetPopUpButtonSelectedItem(panel->button3P, c);
|
||||
|
||||
str = GetStringForKey("MouseWheelAction");
|
||||
i = getWheelAction(str);
|
||||
if (i<0) {
|
||||
w = 0;
|
||||
if (i==-1) {
|
||||
wwarning(_("bad value %s for option %s"), str, "MouseWheelAction");
|
||||
}
|
||||
WMSetPopUpButtonSelectedItem(panel->appP, c);
|
||||
} else {
|
||||
w = i;
|
||||
}
|
||||
WMSetPopUpButtonSelectedItem(panel->wheelP, w);
|
||||
|
||||
WMSetButtonSelected(panel->disaB, GetBoolForKey("DisableWSMouseActions"));
|
||||
|
||||
@@ -458,7 +473,7 @@ createPanel(Panel *p)
|
||||
/**************** Mouse Speed ****************/
|
||||
panel->speedF = WMCreateFrame(panel->box);
|
||||
WMResizeWidget(panel->speedF, 245, 100);
|
||||
WMMoveWidget(panel->speedF, 15, 15);
|
||||
WMMoveWidget(panel->speedF, 15, 5);
|
||||
WMSetFrameTitle(panel->speedF, _("Mouse Speed"));
|
||||
|
||||
panel->speedL = WMCreateLabel(panel->speedF);
|
||||
@@ -515,8 +530,8 @@ createPanel(Panel *p)
|
||||
/***************** Doubleclick Delay ****************/
|
||||
|
||||
panel->ddelaF = WMCreateFrame(panel->box);
|
||||
WMResizeWidget(panel->ddelaF, 245, 95);
|
||||
WMMoveWidget(panel->ddelaF, 15, 125);
|
||||
WMResizeWidget(panel->ddelaF, 245, 105);
|
||||
WMMoveWidget(panel->ddelaF, 15, 115);
|
||||
WMSetFrameTitle(panel->ddelaF, _("Double-Click Delay"));
|
||||
|
||||
buf1 = wmalloc(strlen(DELAY_ICON)+2);
|
||||
@@ -526,7 +541,7 @@ createPanel(Panel *p)
|
||||
panel->ddelaB[i] = WMCreateCustomButton(panel->ddelaF,
|
||||
WBBStateChangeMask);
|
||||
WMResizeWidget(panel->ddelaB[i], 25, 25);
|
||||
WMMoveWidget(panel->ddelaB[i], 30+(40*i), 20);
|
||||
WMMoveWidget(panel->ddelaB[i], 30+(40*i), 25);
|
||||
WMSetButtonBordered(panel->ddelaB[i], False);
|
||||
WMSetButtonImagePosition(panel->ddelaB[i], WIPImageOnly);
|
||||
WMSetButtonAction(panel->ddelaB[i], doubleClick, panel);
|
||||
@@ -563,15 +578,15 @@ createPanel(Panel *p)
|
||||
|
||||
panel->tester = CreateDoubleTest(panel->ddelaF, _("Test"));
|
||||
WMResizeWidget(panel->tester, 84, 29);
|
||||
WMMoveWidget(panel->tester, 35, 55);
|
||||
WMMoveWidget(panel->tester, 35, 60);
|
||||
|
||||
panel->ddelaT = WMCreateTextField(panel->ddelaF);
|
||||
WMResizeWidget(panel->ddelaT, 40, 20);
|
||||
WMMoveWidget(panel->ddelaT, 140, 60);
|
||||
WMMoveWidget(panel->ddelaT, 140, 65);
|
||||
|
||||
panel->ddelaL = WMCreateLabel(panel->ddelaF);
|
||||
WMResizeWidget(panel->ddelaL, 40, 16);
|
||||
WMMoveWidget(panel->ddelaL, 185, 65);
|
||||
WMMoveWidget(panel->ddelaL, 185, 70);
|
||||
{
|
||||
WMFont *font;
|
||||
WMColor *color;
|
||||
@@ -589,59 +604,71 @@ createPanel(Panel *p)
|
||||
|
||||
/* ************** Workspace Action Buttons **************** */
|
||||
panel->menuF = WMCreateFrame(panel->box);
|
||||
WMResizeWidget(panel->menuF, 240, 145);
|
||||
WMMoveWidget(panel->menuF, 270, 15);
|
||||
WMResizeWidget(panel->menuF, 240, 160);
|
||||
WMMoveWidget(panel->menuF, 270, 5);
|
||||
WMSetFrameTitle(panel->menuF, _("Workspace Mouse Actions"));
|
||||
|
||||
panel->disaB = WMCreateSwitchButton(panel->menuF);
|
||||
WMResizeWidget(panel->disaB, 205, 18);
|
||||
WMMoveWidget(panel->disaB, 10, 20);
|
||||
WMMoveWidget(panel->disaB, 10, 18);
|
||||
WMSetButtonText(panel->disaB, _("Disable mouse actions"));
|
||||
|
||||
panel->button1L = WMCreateLabel(panel->menuF);
|
||||
WMResizeWidget(panel->button1L, 87, 20);
|
||||
WMMoveWidget(panel->button1L, 5, 45);
|
||||
WMSetLabelTextAlignment(panel->button1L, WARight);
|
||||
WMSetLabelText(panel->button1L, _("Left Button"));
|
||||
|
||||
panel->appL = WMCreateLabel(panel->menuF);
|
||||
WMResizeWidget(panel->appL, 125, 16);
|
||||
WMMoveWidget(panel->appL, 5, 45);
|
||||
WMSetLabelTextAlignment(panel->appL, WARight);
|
||||
WMSetLabelText(panel->appL, _("Applications menu"));
|
||||
panel->button1P = WMCreatePopUpButton(panel->menuF);
|
||||
WMResizeWidget(panel->button1P, 135, 20);
|
||||
WMMoveWidget(panel->button1P, 95, 45);
|
||||
|
||||
panel->appP = WMCreatePopUpButton(panel->menuF);
|
||||
WMResizeWidget(panel->appP, 95, 20);
|
||||
WMMoveWidget(panel->appP, 135, 45);
|
||||
panel->button2L = WMCreateLabel(panel->menuF);
|
||||
WMResizeWidget(panel->button2L, 87, 20);
|
||||
WMMoveWidget(panel->button2L, 5, 73);
|
||||
WMSetLabelTextAlignment(panel->button2L, WARight);
|
||||
WMSetLabelText(panel->button2L, _("Middle Button"));
|
||||
|
||||
panel->listL = WMCreateLabel(panel->menuF);
|
||||
WMResizeWidget(panel->listL, 125, 16);
|
||||
WMMoveWidget(panel->listL, 5, 80);
|
||||
WMSetLabelTextAlignment(panel->listL, WARight);
|
||||
WMSetLabelText(panel->listL, _("Window list menu"));
|
||||
panel->button2P = WMCreatePopUpButton(panel->menuF);
|
||||
WMResizeWidget(panel->button2P, 135, 20);
|
||||
WMMoveWidget(panel->button2P, 95, 73);
|
||||
|
||||
panel->listP = WMCreatePopUpButton(panel->menuF);
|
||||
WMResizeWidget(panel->listP, 95, 20);
|
||||
WMMoveWidget(panel->listP, 135, 80);
|
||||
panel->button3L = WMCreateLabel(panel->menuF);
|
||||
WMResizeWidget(panel->button3L, 87, 20);
|
||||
WMMoveWidget(panel->button3L, 5, 101);
|
||||
WMSetLabelTextAlignment(panel->button3L, WARight);
|
||||
WMSetLabelText(panel->button3L, _("Right Button"));
|
||||
|
||||
panel->button3P = WMCreatePopUpButton(panel->menuF);
|
||||
WMResizeWidget(panel->button3P, 135, 20);
|
||||
WMMoveWidget(panel->button3P, 95, 101);
|
||||
|
||||
panel->selL = WMCreateLabel(panel->menuF);
|
||||
WMResizeWidget(panel->selL, 125, 16);
|
||||
WMMoveWidget(panel->selL, 5, 115);
|
||||
WMSetLabelTextAlignment(panel->selL, WARight);
|
||||
WMSetLabelText(panel->selL, _("Select windows"));
|
||||
panel->wheelL = WMCreateLabel(panel->menuF);
|
||||
WMResizeWidget(panel->wheelL, 87, 20);
|
||||
WMMoveWidget(panel->wheelL, 5, 129);
|
||||
WMSetLabelTextAlignment(panel->wheelL, WARight);
|
||||
WMSetLabelText(panel->wheelL, _("Mouse Wheel"));
|
||||
|
||||
panel->selP = WMCreatePopUpButton(panel->menuF);
|
||||
WMResizeWidget(panel->selP, 95, 20);
|
||||
WMMoveWidget(panel->selP, 135, 115);
|
||||
panel->wheelP = WMCreatePopUpButton(panel->menuF);
|
||||
WMResizeWidget(panel->wheelP, 135, 20);
|
||||
WMMoveWidget(panel->wheelP, 95, 129);
|
||||
|
||||
for (i = 0; i < sizeof(buttonNames)/sizeof(char*); i++) {
|
||||
WMAddPopUpButtonItem(panel->appP, buttonNames[i]);
|
||||
WMAddPopUpButtonItem(panel->selP, buttonNames[i]);
|
||||
WMAddPopUpButtonItem(panel->listP, buttonNames[i]);
|
||||
for (i = 0; i < sizeof(buttonActions)/sizeof(char*); i++) {
|
||||
WMAddPopUpButtonItem(panel->button1P, buttonActions[i]);
|
||||
WMAddPopUpButtonItem(panel->button2P, buttonActions[i]);
|
||||
WMAddPopUpButtonItem(panel->button3P, buttonActions[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(wheelActions)/sizeof(char*); i++) {
|
||||
WMAddPopUpButtonItem(panel->wheelP, wheelActions[i]);
|
||||
}
|
||||
|
||||
WMMapSubwidgets(panel->menuF);
|
||||
|
||||
/* ************** Grab Modifier **************** */
|
||||
panel->grabF = WMCreateFrame(panel->box);
|
||||
WMResizeWidget(panel->grabF, 240, 55);
|
||||
WMMoveWidget(panel->grabF, 270, 165);
|
||||
WMResizeWidget(panel->grabF, 240, 50);
|
||||
WMMoveWidget(panel->grabF, 270, 170);
|
||||
WMSetFrameTitle(panel->grabF, _("Mouse Grab Modifier"));
|
||||
|
||||
WMSetBalloonTextForView(_("Keyboard modifier to use for actions that\n"
|
||||
@@ -651,7 +678,7 @@ createPanel(Panel *p)
|
||||
|
||||
panel->grabP = WMCreatePopUpButton(panel->grabF);
|
||||
WMResizeWidget(panel->grabP, 160, 20);
|
||||
WMMoveWidget(panel->grabP, 40, 25);
|
||||
WMMoveWidget(panel->grabP, 40, 20);
|
||||
|
||||
fillModifierPopUp(panel->grabP);
|
||||
|
||||
@@ -746,7 +773,8 @@ storeData(_Panel *panel)
|
||||
char buffer[64];
|
||||
int i;
|
||||
char *tmp, *p;
|
||||
static char *button[6] = {"None", "left", "middle", "right", "Button4", "Button5"};
|
||||
static char *button[4] = {"None", "OpenApplicationsMenu", "OpenWindowListMenu", "SelectWindows"};
|
||||
static char *wheel[2] = {"None", "SwitchWorkspaces"};
|
||||
WMUserDefaults *udb = WMGetStandardUserDefaults();
|
||||
|
||||
if (!WMGetUDBoolForKey(udb, "NoXSetStuff")) {
|
||||
@@ -769,14 +797,17 @@ storeData(_Panel *panel)
|
||||
|
||||
SetBoolForKey(WMGetButtonSelected(panel->disaB), "DisableWSMouseActions");
|
||||
|
||||
i = WMGetPopUpButtonSelectedItem(panel->appP);
|
||||
SetStringForKey(button[i], "ApplicationMenuMouseButton");
|
||||
i = WMGetPopUpButtonSelectedItem(panel->button1P);
|
||||
SetStringForKey(button[i], "MouseLeftButtonAction");
|
||||
|
||||
i = WMGetPopUpButtonSelectedItem(panel->listP);
|
||||
SetStringForKey(button[i], "WindowListMouseButton");
|
||||
i = WMGetPopUpButtonSelectedItem(panel->button2P);
|
||||
SetStringForKey(button[i], "MouseMiddleButtonAction");
|
||||
|
||||
i = WMGetPopUpButtonSelectedItem(panel->selP);
|
||||
SetStringForKey(button[i], "SelectWindowsMouseButton");
|
||||
i = WMGetPopUpButtonSelectedItem(panel->button3P);
|
||||
SetStringForKey(button[i], "MouseRightButtonAction");
|
||||
|
||||
i = WMGetPopUpButtonSelectedItem(panel->wheelP);
|
||||
SetStringForKey(wheel[i], "MouseWheelAction");
|
||||
|
||||
tmp = WMGetPopUpButtonItem(panel->grabP,
|
||||
WMGetPopUpButtonSelectedItem(panel->grabP));
|
||||
@@ -804,12 +835,13 @@ InitMouseSettings(WMScreen *scr, WMWidget *parent)
|
||||
modifierNames[6] = wstrdup(_("Mod4"));
|
||||
modifierNames[7] = wstrdup(_("Mod5"));
|
||||
|
||||
buttonNames[0] = wstrdup(_("None"));
|
||||
buttonNames[1] = wstrdup(_("Btn1 (left)"));
|
||||
buttonNames[2] = wstrdup(_("Btn2 (middle)"));
|
||||
buttonNames[3] = wstrdup(_("Btn3 (right)"));
|
||||
buttonNames[4] = wstrdup(_("Btn4"));
|
||||
buttonNames[5] = wstrdup(_("Btn5"));
|
||||
buttonActions[0] = wstrdup(_("None"));
|
||||
buttonActions[1] = wstrdup(_("Applications Menu"));
|
||||
buttonActions[2] = wstrdup(_("Window List Menu"));
|
||||
buttonActions[3] = wstrdup(_("Select Windows"));
|
||||
|
||||
wheelActions[0] = wstrdup(_("None"));
|
||||
wheelActions[1] = wstrdup(_("Switch Workspaces"));
|
||||
|
||||
panel = wmalloc(sizeof(_Panel));
|
||||
memset(panel, 0, sizeof(_Panel));
|
||||
|
||||
@@ -270,10 +270,10 @@ createPanel(Panel *p)
|
||||
WMAddPopUpButtonItem(panel->posP, _("Center"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Top"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Bottom"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Top/left"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Top/right"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Bottom/left"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Bottom/right"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Top/Left"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Top/Right"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Bottom/Left"));
|
||||
WMAddPopUpButtonItem(panel->posP, _("Bottom/Right"));
|
||||
|
||||
WMMapSubwidgets(panel->navF);
|
||||
|
||||
|
||||
@@ -31,9 +31,10 @@
|
||||
IconSize = 64;
|
||||
FocusMode = manual;
|
||||
DisableWSMouseActions = NO;
|
||||
SelectWindowsMouseButton = left;
|
||||
WindowListMouseButton = middle;
|
||||
ApplicationMenuMouseButton = right;
|
||||
MouseLeftButtonAction = SelectWindows;
|
||||
MouseMiddleButtonAction = OpenWindowListMenu;
|
||||
MouseRightButtonAction = OpenApplicationsMenu;
|
||||
MouseWheelAction = None;
|
||||
ColormapSize = 4;
|
||||
DisableDithering = NO;
|
||||
ModifierKey = Mod1;
|
||||
|
||||
@@ -217,6 +217,12 @@ typedef enum {
|
||||
#define MS_SINGLE_TEXTURE 1
|
||||
#define MS_FLAT 2
|
||||
|
||||
/* workspace actions */
|
||||
#define WA_NONE 0
|
||||
#define WA_SELECT_WINDOWS 1
|
||||
#define WA_OPEN_APPMENU 2
|
||||
#define WA_OPEN_WINLISTMENU 3
|
||||
#define WA_SWITCH_WORKSPACES 4
|
||||
|
||||
/* workspace display position */
|
||||
#define WD_NONE 0
|
||||
@@ -431,9 +437,10 @@ typedef struct WPreferences {
|
||||
char superfluous; /* Use superfluous things */
|
||||
|
||||
/* root window mouse bindings */
|
||||
signed char select_button; /* button for window selection */
|
||||
signed char windowl_button; /* button for window list menu */
|
||||
signed char menu_button; /* button for app menu */
|
||||
signed char mouse_button1; /* action for left mouse button */
|
||||
signed char mouse_button2; /* action for middle mouse button */
|
||||
signed char mouse_button3; /* action for right mouse button */
|
||||
signed char mouse_wheel; /* action for mouse wheel */
|
||||
|
||||
/* balloon text */
|
||||
char window_balloon;
|
||||
|
||||
@@ -262,13 +262,17 @@ static WOptionEnumeration seSpeeds[] = {
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
static WOptionEnumeration seMouseButtons[] = {
|
||||
{"None", -1, 0},
|
||||
{"Left", Button1, 0}, {"Button1", Button1, 1},
|
||||
{"Middle", Button2, 0}, {"Button2", Button2, 1},
|
||||
{"Right", Button3, 0}, {"Button3", Button3, 1},
|
||||
{"Button4", Button4, 0},
|
||||
{"Button5", Button5, 0},
|
||||
static WOptionEnumeration seMouseButtonActions[] = {
|
||||
{"None", WA_NONE, 0},
|
||||
{"SelectWindows", WA_SELECT_WINDOWS, 0},
|
||||
{"OpenApplicationsMenu", WA_OPEN_APPMENU, 0},
|
||||
{"OpenWindowListMenu", WA_OPEN_WINLISTMENU, 0},
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
static WOptionEnumeration seMouseWheelActions[] = {
|
||||
{"None", WA_NONE, 0},
|
||||
{"SwitchWorkspaces", WA_SWITCH_WORKSPACES, 0},
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
@@ -389,14 +393,17 @@ WDefaultEntry optionList[] = {
|
||||
{"IconificationStyle", "Zoom", seIconificationStyles,
|
||||
&wPreferences.iconification_style, getEnum, NULL
|
||||
},
|
||||
{"SelectWindowsMouseButton", "Left", seMouseButtons,
|
||||
&wPreferences.select_button, getEnum, NULL
|
||||
{"MouseLeftButtonAction", "SelectWindows", seMouseButtonActions,
|
||||
&wPreferences.mouse_button1, getEnum, NULL
|
||||
},
|
||||
{"WindowListMouseButton", "Middle", seMouseButtons,
|
||||
&wPreferences.windowl_button, getEnum, NULL
|
||||
{"MouseMiddleButtonAction", "OpenWindowListMenu", seMouseButtonActions,
|
||||
&wPreferences.mouse_button2, getEnum, NULL
|
||||
},
|
||||
{"ApplicationMenuMouseButton", "Right", seMouseButtons,
|
||||
&wPreferences.menu_button, getEnum, NULL
|
||||
{"MouseRightButtonAction", "OpenApplicationsMenu", seMouseButtonActions,
|
||||
&wPreferences.mouse_button3, getEnum, NULL
|
||||
},
|
||||
{"MouseWheelAction", "None", seMouseWheelActions,
|
||||
&wPreferences.mouse_wheel, getEnum, NULL
|
||||
},
|
||||
{"PixmapPath", DEF_PIXMAP_PATHS, NULL,
|
||||
&wPreferences.pixmap_path, getPathList, NULL
|
||||
|
||||
72
src/event.c
72
src/event.c
@@ -590,6 +590,39 @@ handleExpose(XEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
executeButtonAction(WScreen *scr, XEvent *event, int action)
|
||||
{
|
||||
switch(action) {
|
||||
case WA_SELECT_WINDOWS:
|
||||
wUnselectWindows(scr);
|
||||
wSelectWindows(scr, event);
|
||||
break;
|
||||
case WA_OPEN_APPMENU:
|
||||
OpenRootMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
|
||||
/* ugly hack */
|
||||
if (scr->root_menu) {
|
||||
if (scr->root_menu->brother->flags.mapped)
|
||||
event->xbutton.window = scr->root_menu->brother->frame->core->window;
|
||||
else
|
||||
event->xbutton.window = scr->root_menu->frame->core->window;
|
||||
}
|
||||
break;
|
||||
case WA_OPEN_WINLISTMENU:
|
||||
OpenSwitchMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
|
||||
if (scr->switch_menu) {
|
||||
if (scr->switch_menu->brother->flags.mapped)
|
||||
event->xbutton.window = scr->switch_menu->brother->frame->core->window;
|
||||
else
|
||||
event->xbutton.window = scr->switch_menu->frame->core->window;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* bindable */
|
||||
static void
|
||||
handleButtonPress(XEvent *event)
|
||||
@@ -609,32 +642,21 @@ handleButtonPress(XEvent *event)
|
||||
|
||||
#ifndef LITE
|
||||
if (event->xbutton.window==scr->root_win) {
|
||||
if (event->xbutton.button==wPreferences.menu_button) {
|
||||
OpenRootMenu(scr, event->xbutton.x_root,
|
||||
event->xbutton.y_root, False);
|
||||
/* ugly hack */
|
||||
if (scr->root_menu) {
|
||||
if (scr->root_menu->brother->flags.mapped)
|
||||
event->xbutton.window = scr->root_menu->brother->frame->core->window;
|
||||
else
|
||||
event->xbutton.window = scr->root_menu->frame->core->window;
|
||||
}
|
||||
} else if (event->xbutton.button==wPreferences.windowl_button) {
|
||||
OpenSwitchMenu(scr, event->xbutton.x_root,
|
||||
event->xbutton.y_root, False);
|
||||
if (scr->switch_menu) {
|
||||
if (scr->switch_menu->brother->flags.mapped)
|
||||
event->xbutton.window = scr->switch_menu->brother->frame->core->window;
|
||||
else
|
||||
event->xbutton.window = scr->switch_menu->frame->core->window;
|
||||
}
|
||||
} else if (event->xbutton.button==wPreferences.select_button) {
|
||||
wUnselectWindows(scr);
|
||||
wSelectWindows(scr, event);
|
||||
} else if (event->xbutton.button==Button5) {
|
||||
wWorkspaceRelativeChange(scr, -1);
|
||||
} else if (event->xbutton.button==Button4) {
|
||||
if (event->xbutton.button==Button1 &&
|
||||
wPreferences.mouse_button1!=WA_NONE) {
|
||||
executeButtonAction(scr, event, wPreferences.mouse_button1);
|
||||
} else if (event->xbutton.button==Button2 &&
|
||||
wPreferences.mouse_button2!=WA_NONE) {
|
||||
executeButtonAction(scr, event, wPreferences.mouse_button2);
|
||||
} else if (event->xbutton.button==Button3 &&
|
||||
wPreferences.mouse_button3!=WA_NONE) {
|
||||
executeButtonAction(scr, event, wPreferences.mouse_button3);
|
||||
} else if (event->xbutton.button==Button4 &&
|
||||
wPreferences.mouse_wheel!=WA_NONE) {
|
||||
wWorkspaceRelativeChange(scr, 1);
|
||||
} else if (event->xbutton.button==Button5 &&
|
||||
wPreferences.mouse_wheel!=WA_NONE) {
|
||||
wWorkspaceRelativeChange(scr, -1);
|
||||
}
|
||||
#ifdef GNOME_STUFF
|
||||
else if (wGNOMEProxyizeButtonEvent(scr, event))
|
||||
|
||||
Reference in New Issue
Block a user