Xlib must now be included in spmenu.c

Also, we should be checking the length of wl_cbuttons, not cbuttons on
Wayland.
This commit is contained in:
speedie 2023-06-23 04:04:02 +02:00
parent 59983981c2
commit 152b14330f
2 changed files with 7 additions and 2 deletions

View file

@ -304,7 +304,7 @@ void buttonpress_wl(uint32_t button, double ex, double ey) {
// ClickSelItem, called function doesn't matter // 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)) { 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 (sp.ignoreglobalmouse) break;
if (wl_buttons[i].click == ClickSelItem && wl_buttons[i].button == button) { if (wl_buttons[i].click == ClickSelItem && wl_buttons[i].button == button) {
puts(item->text); puts(item->text);
@ -313,7 +313,7 @@ void buttonpress_wl(uint32_t button, double ex, double ey) {
click = ClickItem; click = ClickItem;
} }
} }
for (i = 0; i < LENGTH(cbuttons); i++) { for (i = 0; i < LENGTH(wl_cbuttons); i++) {
if (sp.ignoreconfmouse) break; if (sp.ignoreconfmouse) break;
if (wl_cbuttons[i].click == ClickSelItem && wl_cbuttons[i].button == button) { if (wl_cbuttons[i].click == ClickSelItem && wl_cbuttons[i].button == button) {
puts(item->text); puts(item->text);

View file

@ -80,6 +80,11 @@
#include <openssl/md5.h> #include <openssl/md5.h>
#endif #endif
// include Xlib
#if USEX
#include <X11/Xlib.h>
#endif
// include macros and other defines // include macros and other defines
#include "libs/define.c" #include "libs/define.c"