diff --git a/libs/conf/config.h b/libs/conf/config.h index f001955..d249058 100644 --- a/libs/conf/config.h +++ b/libs/conf/config.h @@ -665,6 +665,8 @@ static ButtonType w_btp[] = { { "Left Click", WL_Left }, { "Middle Click", WL_Middle }, { "Right Click", WL_Right }, + { "Scroll Up", WL_Up }, + { "Scroll Down", WL_Down }, }; #endif @@ -682,6 +684,7 @@ static ClickType ctp[] = { #if USEIMAGE { "ClickImage", ClickImage }, #endif + { "None", ClickNone }, }; static void conf_init(void); diff --git a/libs/wl/wayland.c b/libs/wl/wayland.c index f982428..9d442a6 100644 --- a/libs/wl/wayland.c +++ b/libs/wl/wayland.c @@ -345,14 +345,14 @@ void buttonpress_wl(uint32_t button, double ex, double ey) { // go through mouse button array and run function for (i = 0; i < LENGTH(wl_buttons); i++) { 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); } // go through mouse config array and run function for (i = 0; i < LENGTH(wl_cbuttons); i++) { 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); } } diff --git a/libs/wl/wayland.h b/libs/wl/wayland.h index 3775c8f..a80c30b 100644 --- a/libs/wl/wayland.h +++ b/libs/wl/wayland.h @@ -65,6 +65,8 @@ static WlMouse wl_cbuttons[256]; #define WL_Forward 0x115 #define WL_Back 0x116 #define WL_Task 0x117 +#define WL_Up 0x151 +#define WL_Down 0x150 static WlKey wlhkeys[1] = { { -1, WL_CtrlAlt, XKB_KEY_Delete, quit, {0} } }; diff --git a/libs/x11/mouse.c b/libs/x11/mouse.c index 0bf386d..4c9c5f8 100644 --- a/libs/x11/mouse.c +++ b/libs/x11/mouse.c @@ -129,14 +129,14 @@ void buttonpress_x11(XEvent *e) { // go through mouse button array and run function for (i = 0; i < LENGTH(buttons); i++) { 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); } // go through mouse config array and run function for (i = 0; i < LENGTH(cbuttons); i++) { 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); } } diff --git a/scripts/spmenu_run b/scripts/spmenu_run index 69652bb..f16779e 100755 --- a/scripts/spmenu_run +++ b/scripts/spmenu_run @@ -411,9 +411,6 @@ main() { read -ra desktopdir <<< "${DESKTOP_DIR}" read -ra icondir <<< "${ICON_DIR}" - # clear cache - [ "$clearcache" = "true" ] && clear_cache - # $PATH listing case "$function" in "run") @@ -426,6 +423,7 @@ main() { ;; "desktop") load_x "spmenu_desktop" || exit 1 + [ "$clearcache" = "true" ] && clear_cache prep_desktop print_desktop_menu "$args" ;; diff --git a/spmenu.c b/spmenu.c index 7c9abfc..e152e0c 100644 --- a/spmenu.c +++ b/spmenu.c @@ -107,6 +107,7 @@ enum { ClickCaps, ClickMode, ClickImage, + ClickNone, }; struct item {