mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 22:28:02 +01:00
wmaker: make disable mouse actions a live set
This patch is allowing to enable or disable the 'disable mouse actions' from the WPrefs app without requiring to restart the session.
This commit is contained in:
committed by
Carlos R. Mafra
parent
51b342fee5
commit
fec8347d27
@@ -324,8 +324,6 @@ WDefaultEntry staticOptionList[] = {
|
|||||||
&wPreferences.icon_size, getInt, NULL, NULL, NULL},
|
&wPreferences.icon_size, getInt, NULL, NULL, NULL},
|
||||||
{"ModifierKey", "Mod1", NULL,
|
{"ModifierKey", "Mod1", NULL,
|
||||||
&wPreferences.modifier_mask, getModMask, NULL, NULL, NULL},
|
&wPreferences.modifier_mask, getModMask, NULL, NULL, NULL},
|
||||||
{"DisableWSMouseActions", "NO", NULL,
|
|
||||||
&wPreferences.disable_root_mouse, getBool, NULL, NULL, NULL},
|
|
||||||
{"FocusMode", "manual", seFocusModes, /* have a problem when switching from */
|
{"FocusMode", "manual", seFocusModes, /* have a problem when switching from */
|
||||||
&wPreferences.focus_mode, getEnum, NULL, NULL, NULL}, /* manual to sloppy without restart */
|
&wPreferences.focus_mode, getEnum, NULL, NULL, NULL}, /* manual to sloppy without restart */
|
||||||
{"NewStyle", "new", seTitlebarModes,
|
{"NewStyle", "new", seTitlebarModes,
|
||||||
@@ -353,6 +351,8 @@ WDefaultEntry optionList[] = {
|
|||||||
&wPreferences.icon_yard, getEnum, setIconPosition, NULL, NULL},
|
&wPreferences.icon_yard, getEnum, setIconPosition, NULL, NULL},
|
||||||
{"IconificationStyle", "Zoom", seIconificationStyles,
|
{"IconificationStyle", "Zoom", seIconificationStyles,
|
||||||
&wPreferences.iconification_style, getEnum, NULL, NULL, NULL},
|
&wPreferences.iconification_style, getEnum, NULL, NULL, NULL},
|
||||||
|
{"DisableWSMouseActions", "NO", NULL,
|
||||||
|
&wPreferences.disable_root_mouse, getBool, NULL, NULL, NULL},
|
||||||
{"MouseLeftButtonAction", "SelectWindows", seMouseButtonActions,
|
{"MouseLeftButtonAction", "SelectWindows", seMouseButtonActions,
|
||||||
&wPreferences.mouse_button1, getEnum, NULL, NULL, NULL},
|
&wPreferences.mouse_button1, getEnum, NULL, NULL, NULL},
|
||||||
{"MouseMiddleButtonAction", "OpenWindowListMenu", seMouseButtonActions,
|
{"MouseMiddleButtonAction", "OpenWindowListMenu", seMouseButtonActions,
|
||||||
|
|||||||
@@ -745,7 +745,7 @@ static void handleButtonPress(XEvent * event)
|
|||||||
wBalloonHide(scr);
|
wBalloonHide(scr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (event->xbutton.window == scr->root_win) {
|
if (!wPreferences.disable_root_mouse && event->xbutton.window == scr->root_win) {
|
||||||
if (event->xbutton.button == Button1 && wPreferences.mouse_button1 != WA_NONE) {
|
if (event->xbutton.button == Button1 && wPreferences.mouse_button1 != WA_NONE) {
|
||||||
executeButtonAction(scr, event, wPreferences.mouse_button1);
|
executeButtonAction(scr, event, wPreferences.mouse_button1);
|
||||||
} else if (event->xbutton.button == Button2 && wPreferences.mouse_button2 != WA_NONE) {
|
} else if (event->xbutton.button == Button2 && wPreferences.mouse_button2 != WA_NONE) {
|
||||||
|
|||||||
@@ -524,11 +524,6 @@ WScreen *wScreenInit(int screen_number)
|
|||||||
oldHandler = XSetErrorHandler(alreadyRunningError);
|
oldHandler = XSetErrorHandler(alreadyRunningError);
|
||||||
|
|
||||||
event_mask = EVENT_MASK;
|
event_mask = EVENT_MASK;
|
||||||
|
|
||||||
if (wPreferences.disable_root_mouse) {
|
|
||||||
event_mask &= ~(ButtonPressMask | ButtonReleaseMask);
|
|
||||||
}
|
|
||||||
|
|
||||||
XSelectInput(dpy, scr->root_win, event_mask);
|
XSelectInput(dpy, scr->root_win, event_mask);
|
||||||
|
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
|
|||||||
Reference in New Issue
Block a user