From 5b83ba523637916b6692ad10aa75a1b2bef196c1 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 21 May 2026 18:12:35 +0800 Subject: [PATCH] fix: fix typo for idleinhibit_when_focus option in windowrule --- docs/window-management/rules.md | 2 +- src/config/parse_config.h | 8 ++++---- src/mango.c | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/window-management/rules.md b/docs/window-management/rules.md index 4a295157..acfd5a79 100644 --- a/docs/window-management/rules.md +++ b/docs/window-management/rules.md @@ -34,7 +34,7 @@ windowrule=Parameter:Values,Parameter:Values,appid:Values,title:Values | `noopenmaximized` | integer | `0` / `1` | Window does not open as maximized mode | | `single_scratchpad` | integer | `0` / `1` (default 1) | Only show one out of named scratchpads or the normal scratchpad | | `allow_shortcuts_inhibit` | integer | `0` / `1` (default 1) | Allow shortcuts to be inhibited by clients | -| `indleinhibit_when_focus` | integer | `0` / `1` (default 0) | Automatically keep idle inhibit active when this window is focused | +| `idleinhibit_when_focus` | integer | `0` / `1` (default 0) | Automatically keep idle inhibit active when this window is focused | ### Geometry & Position diff --git a/src/config/parse_config.h b/src/config/parse_config.h index c19e9ab1..ebbba3bc 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -78,7 +78,7 @@ typedef struct { int32_t ignore_maximize; int32_t ignore_minimize; int32_t isnosizehint; - int32_t indleinhibit_when_focus; + int32_t idleinhibit_when_focus; char *monitor; int32_t offsetx; int32_t offsety; @@ -2137,7 +2137,7 @@ bool parse_option(Config *config, char *key, char *value) { rule->ignore_maximize = -1; rule->ignore_minimize = -1; rule->isnosizehint = -1; - rule->indleinhibit_when_focus = -1; + rule->idleinhibit_when_focus = -1; rule->isterm = -1; rule->allow_csd = -1; rule->force_fakemaximize = -1; @@ -2248,8 +2248,8 @@ bool parse_option(Config *config, char *key, char *value) { rule->ignore_minimize = atoi(val); } else if (strcmp(key, "isnosizehint") == 0) { rule->isnosizehint = atoi(val); - } else if (strcmp(key, "indleinhibit_when_focus") == 0) { - rule->indleinhibit_when_focus = atoi(val); + } else if (strcmp(key, "idleinhibit_when_focus") == 0) { + rule->idleinhibit_when_focus = atoi(val); } else if (strcmp(key, "isterm") == 0) { rule->isterm = atoi(val); } else if (strcmp(key, "allow_csd") == 0) { diff --git a/src/mango.c b/src/mango.c index 66d9c6da..25d051c1 100644 --- a/src/mango.c +++ b/src/mango.c @@ -356,7 +356,7 @@ struct Client { struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel; int32_t isfloating, isurgent, isfullscreen, isfakefullscreen, need_float_size_reduce, isminimized, isoverlay, isnosizehint, - ignore_maximize, ignore_minimize, indleinhibit_when_focus; + ignore_maximize, ignore_minimize, idleinhibit_when_focus; int32_t ismaximizescreen; int32_t overview_backup_bw; int32_t fullscreen_backup_x, fullscreen_backup_y, fullscreen_backup_w, @@ -1504,7 +1504,7 @@ static void apply_rule_properties(Client *c, const ConfigWinRule *r) { APPLY_INT_PROP(c, r, ignore_maximize); APPLY_INT_PROP(c, r, ignore_minimize); APPLY_INT_PROP(c, r, isnosizehint); - APPLY_INT_PROP(c, r, indleinhibit_when_focus); + APPLY_INT_PROP(c, r, idleinhibit_when_focus); APPLY_INT_PROP(c, r, isunglobal); APPLY_INT_PROP(c, r, noblur); APPLY_INT_PROP(c, r, allow_shortcuts_inhibit); @@ -4383,7 +4383,7 @@ void init_client_properties(Client *c) { c->force_tiled_state = 1; c->force_tearing = 0; c->allow_shortcuts_inhibit = SHORTCUTS_INHIBIT_ENABLE; - c->indleinhibit_when_focus = 0; + c->idleinhibit_when_focus = 0; c->scroller_proportion_single = 0.0f; c->float_geom.width = 0; c->float_geom.height = 0; @@ -6243,7 +6243,7 @@ int32_t hidecursor(void *data) { } void check_keep_idle_inhibit(Client *c) { - if (c && c->indleinhibit_when_focus && keep_idle_inhibit_source) { + if (c && c->idleinhibit_when_focus && keep_idle_inhibit_source) { wl_event_source_timer_update(keep_idle_inhibit_source, 1000); } } @@ -6260,7 +6260,7 @@ int32_t keep_idle_inhibit(void *data) { return 1; } - if (!selmon || !selmon->sel || !selmon->sel->indleinhibit_when_focus) { + if (!selmon || !selmon->sel || !selmon->sel->idleinhibit_when_focus) { wl_event_source_timer_update(keep_idle_inhibit_source, 0); return 1; }