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 -14
View File
@@ -3,6 +3,7 @@
#include <wlr/types/wlr_scene.h>
#include "client.h"
#include "monitor.h"
#include "common.h"
/* Forward declarations from peachwm.c */
extern struct wl_list clients;
@@ -29,20 +30,6 @@ enum {
/* NUM_LAYERS = 9 */
};
/* The argument union used by keybind functions.
* Both peachwm.c and the scratchpad module need to agree on this,
* so it sits here rather than privately in each .c file. */
typedef union {
int i;
uint32_t ui;
float f;
const void *v;
} Arg;
/* Scoped visibility helper — also defined (identically) in layout.c */
int visibleon(Client *c, Monitor *m);
#define VISIBLEON(C, M) visibleon((C), (M))
/* ----------- Extracted scratchpad functions ----------- */
/* Reparent + resize every scratchpad client of @m to a centred 80% box */