refactor: create include/common.h with shared types/macros, deduplicate across 7 files

This commit is contained in:
2026-07-02 01:58:57 -04:00
parent 9581031dac
commit 1e09b182ee
8 changed files with 48 additions and 71 deletions
+1 -13
View File
@@ -8,19 +8,7 @@
#include "util.h"
#include "layout.h"
#include "parser/parser.h"
/* macros (duplicated from peachwm.c) */
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define LENGTH(X) (sizeof X / sizeof X[0])
#define TAGMASK ((1u << TAGCOUNT) - 1)
static inline int visibleon(Client *c, Monitor *m) {
return m && c->mon == m
? (c->isscratchpad ? m->scratchpad_visible
: (int)(c->tags & m->tagset[m->seltags]))
: 0;
}
#define VISIBLEON(C, M) visibleon((C), (M))
#include "common.h"
/* globals from peachwm.c */
extern struct wl_list clients;