From 152b14330fc50bb26a89b9c2eb41520d681ff6fa Mon Sep 17 00:00:00 2001 From: speedie Date: Fri, 23 Jun 2023 04:04:02 +0200 Subject: [PATCH] Xlib must now be included in spmenu.c Also, we should be checking the length of wl_cbuttons, not cbuttons on Wayland. --- libs/wl/wayland.c | 4 ++-- spmenu.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/wl/wayland.c b/libs/wl/wayland.c index 75e774b..539e211 100644 --- a/libs/wl/wayland.c +++ b/libs/wl/wayland.c @@ -304,7 +304,7 @@ void buttonpress_wl(uint32_t button, double ex, double ey) { // ClickSelItem, called function doesn't matter if (ey >= y && ey <= (y + h) && ex >= x + (powerlineitems ? sp.plw : 0) && ex <= (x + w / columns) + (powerlineitems ? sp.plw : 0)) { - for (i = 0; i < LENGTH(buttons); i++) { + for (i = 0; i < LENGTH(wl_buttons); i++) { if (sp.ignoreglobalmouse) break; if (wl_buttons[i].click == ClickSelItem && wl_buttons[i].button == button) { puts(item->text); @@ -313,7 +313,7 @@ void buttonpress_wl(uint32_t button, double ex, double ey) { click = ClickItem; } } - for (i = 0; i < LENGTH(cbuttons); i++) { + for (i = 0; i < LENGTH(wl_cbuttons); i++) { if (sp.ignoreconfmouse) break; if (wl_cbuttons[i].click == ClickSelItem && wl_cbuttons[i].button == button) { puts(item->text); diff --git a/spmenu.c b/spmenu.c index 22aaec0..1a6074b 100644 --- a/spmenu.c +++ b/spmenu.c @@ -80,6 +80,11 @@ #include #endif +// include Xlib +#if USEX +#include +#endif + // include macros and other defines #include "libs/define.c"