Fix cache, add ClickNone
This commit is contained in:
parent
6fd3a96347
commit
1fe08aa295
|
@ -665,6 +665,8 @@ static ButtonType w_btp[] = {
|
||||||
{ "Left Click", WL_Left },
|
{ "Left Click", WL_Left },
|
||||||
{ "Middle Click", WL_Middle },
|
{ "Middle Click", WL_Middle },
|
||||||
{ "Right Click", WL_Right },
|
{ "Right Click", WL_Right },
|
||||||
|
{ "Scroll Up", WL_Up },
|
||||||
|
{ "Scroll Down", WL_Down },
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -682,6 +684,7 @@ static ClickType ctp[] = {
|
||||||
#if USEIMAGE
|
#if USEIMAGE
|
||||||
{ "ClickImage", ClickImage },
|
{ "ClickImage", ClickImage },
|
||||||
#endif
|
#endif
|
||||||
|
{ "None", ClickNone },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void conf_init(void);
|
static void conf_init(void);
|
||||||
|
|
|
@ -345,14 +345,14 @@ void buttonpress_wl(uint32_t button, double ex, double ey) {
|
||||||
// go through mouse button array and run function
|
// go through mouse button array and run function
|
||||||
for (i = 0; i < LENGTH(wl_buttons); i++) {
|
for (i = 0; i < LENGTH(wl_buttons); i++) {
|
||||||
if (sp.ignoreglobalmouse) break;
|
if (sp.ignoreglobalmouse) break;
|
||||||
if (click == wl_buttons[i].click && wl_buttons[i].func && wl_buttons[i].button == button)
|
if ((click == wl_buttons[i].click || wl_buttons[i].click == ClickNone) && wl_buttons[i].func && wl_buttons[i].button == button)
|
||||||
wl_buttons[i].func(&wl_buttons[i].arg);
|
wl_buttons[i].func(&wl_buttons[i].arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// go through mouse config array and run function
|
// go through mouse config array and run function
|
||||||
for (i = 0; i < LENGTH(wl_cbuttons); i++) {
|
for (i = 0; i < LENGTH(wl_cbuttons); i++) {
|
||||||
if (sp.ignoreconfmouse) break;
|
if (sp.ignoreconfmouse) break;
|
||||||
if (click == wl_cbuttons[i].click && wl_cbuttons[i].func && wl_cbuttons[i].button == button)
|
if ((click == wl_cbuttons[i].click || wl_cbuttons[i].click == ClickNone) && wl_cbuttons[i].func && wl_cbuttons[i].button == button)
|
||||||
wl_cbuttons[i].func(&wl_cbuttons[i].arg);
|
wl_cbuttons[i].func(&wl_cbuttons[i].arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,8 @@ static WlMouse wl_cbuttons[256];
|
||||||
#define WL_Forward 0x115
|
#define WL_Forward 0x115
|
||||||
#define WL_Back 0x116
|
#define WL_Back 0x116
|
||||||
#define WL_Task 0x117
|
#define WL_Task 0x117
|
||||||
|
#define WL_Up 0x151
|
||||||
|
#define WL_Down 0x150
|
||||||
|
|
||||||
static WlKey wlhkeys[1] = { { -1, WL_CtrlAlt, XKB_KEY_Delete, quit, {0} } };
|
static WlKey wlhkeys[1] = { { -1, WL_CtrlAlt, XKB_KEY_Delete, quit, {0} } };
|
||||||
|
|
||||||
|
|
|
@ -129,14 +129,14 @@ void buttonpress_x11(XEvent *e) {
|
||||||
// go through mouse button array and run function
|
// go through mouse button array and run function
|
||||||
for (i = 0; i < LENGTH(buttons); i++) {
|
for (i = 0; i < LENGTH(buttons); i++) {
|
||||||
if (sp.ignoreglobalmouse) break;
|
if (sp.ignoreglobalmouse) break;
|
||||||
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button)
|
if ((click == buttons[i].click || buttons[i].click == ClickNone) && buttons[i].func && buttons[i].button == ev->button)
|
||||||
buttons[i].func(&buttons[i].arg);
|
buttons[i].func(&buttons[i].arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// go through mouse config array and run function
|
// go through mouse config array and run function
|
||||||
for (i = 0; i < LENGTH(cbuttons); i++) {
|
for (i = 0; i < LENGTH(cbuttons); i++) {
|
||||||
if (sp.ignoreconfmouse) break;
|
if (sp.ignoreconfmouse) break;
|
||||||
if (click == cbuttons[i].click && cbuttons[i].func && cbuttons[i].button == ev->button)
|
if ((click == cbuttons[i].click || cbuttons[i].click == ClickNone) && cbuttons[i].func && cbuttons[i].button == ev->button)
|
||||||
cbuttons[i].func(&cbuttons[i].arg);
|
cbuttons[i].func(&cbuttons[i].arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,9 +411,6 @@ main() {
|
||||||
read -ra desktopdir <<< "${DESKTOP_DIR}"
|
read -ra desktopdir <<< "${DESKTOP_DIR}"
|
||||||
read -ra icondir <<< "${ICON_DIR}"
|
read -ra icondir <<< "${ICON_DIR}"
|
||||||
|
|
||||||
# clear cache
|
|
||||||
[ "$clearcache" = "true" ] && clear_cache
|
|
||||||
|
|
||||||
# $PATH listing
|
# $PATH listing
|
||||||
case "$function" in
|
case "$function" in
|
||||||
"run")
|
"run")
|
||||||
|
@ -426,6 +423,7 @@ main() {
|
||||||
;;
|
;;
|
||||||
"desktop")
|
"desktop")
|
||||||
load_x "spmenu_desktop" || exit 1
|
load_x "spmenu_desktop" || exit 1
|
||||||
|
[ "$clearcache" = "true" ] && clear_cache
|
||||||
prep_desktop
|
prep_desktop
|
||||||
print_desktop_menu "$args"
|
print_desktop_menu "$args"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue