From 9147a526b609843c7ede8b7757fe08ce7acb22b7 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 6 Aug 2025 21:36:52 +0100 Subject: add MAX_ITEMS, minimise XGrabButton -> grab_button function --- src/defs.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/defs.h') diff --git a/src/defs.h b/src/defs.h index 930f4b7..63cf4a0 100644 --- a/src/defs.h +++ b/src/defs.h @@ -22,6 +22,7 @@ #define MAXCLIENTS 99 #define MAX_SCRATCHPADS 20 #define MIN_WINDOW_SIZE 20 +#define MAX_ITEMS 256 #define BIND(mod, key, cmdstr) {(mod), XK_##key, {cmdstr}, False} #define CALL(mod, key, fnptr) {(mod), XK_##key, {.fn = fnptr}, True} #define CMD(name, ...) const char *name[] = {__VA_ARGS__, NULL} @@ -102,14 +103,14 @@ typedef struct { Bool new_win_focus; Bool warp_cursor; Bool new_win_master; - Binding binds[256]; - char **should_float[256]; - char **start_fullscreen[256]; - char **can_swallow[256]; - char **can_be_swallowed[256]; + Binding binds[MAX_ITEMS]; + char **should_float[MAX_ITEMS]; + char **start_fullscreen[MAX_ITEMS]; + char **can_swallow[MAX_ITEMS]; + char **can_be_swallowed[MAX_ITEMS]; char **scratchpads[32]; - char **open_in_workspace[256]; - char *torun[256]; + char **open_in_workspace[MAX_ITEMS]; + char *torun[MAX_ITEMS]; } Config; typedef struct { -- cgit v1.2.3