mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-19 14:33:16 -04:00
buffer size is now a named constant witha single source of truth
This commit is contained in:
parent
a7a7f2f106
commit
8dbdfb21ad
3 changed files with 4 additions and 3 deletions
|
|
@ -114,7 +114,7 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) {
|
||||||
xkb_layout_index_t current;
|
xkb_layout_index_t current;
|
||||||
int32_t tagmask, state, numclients, focused_client, tag;
|
int32_t tagmask, state, numclients, focused_client, tag;
|
||||||
const char *title, *appid, *symbol;
|
const char *title, *appid, *symbol;
|
||||||
char kb_layout[32];
|
char kb_layout[KB_LAYOUT_ABBR_SIZE];
|
||||||
focused = focustop(monitor);
|
focused = focustop(monitor);
|
||||||
zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
|
zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ void get_layout_abbr(char *abbr, const char *full_name) {
|
||||||
// 1. 尝试在映射表中查找
|
// 1. 尝试在映射表中查找
|
||||||
for (int32_t i = 0; layout_mappings[i].full_name != NULL; i++) {
|
for (int32_t i = 0; layout_mappings[i].full_name != NULL; i++) {
|
||||||
if (strcmp(full_name, layout_mappings[i].full_name) == 0) {
|
if (strcmp(full_name, layout_mappings[i].full_name) == 0) {
|
||||||
snprintf(abbr, 32, "%s", layout_mappings[i].abbr);
|
snprintf(abbr, KB_LAYOUT_ABBR_SIZE, "%s", layout_mappings[i].abbr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -73,7 +73,7 @@ void get_layout_abbr(char *abbr, const char *full_name) {
|
||||||
abbr[2] = '\0';
|
abbr[2] = '\0';
|
||||||
} else {
|
} else {
|
||||||
// 5. 最终回退:返回 "xx"
|
// 5. 最终回退:返回 "xx"
|
||||||
snprintf(abbr, 32, "xx");
|
snprintf(abbr, KB_LAYOUT_ABBR_SIZE, "xx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@
|
||||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
||||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
||||||
#define GEZERO(A) ((A) >= 0 ? (A) : 0)
|
#define GEZERO(A) ((A) >= 0 ? (A) : 0)
|
||||||
|
#define KB_LAYOUT_ABBR_SIZE 32
|
||||||
#define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS)
|
#define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS)
|
||||||
#define INSIDEMON(A) \
|
#define INSIDEMON(A) \
|
||||||
(A->geom.x >= A->mon->m.x && A->geom.y >= A->mon->m.y && \
|
(A->geom.x >= A->mon->m.x && A->geom.y >= A->mon->m.y && \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue