feat: add maximize window support with MRU focus tracking and demo timing configs

Implement client maximize/unmaximize toggle and state tracking via CLIENT_MAXIMIZED flag, add MRU (most-recently-used) doubly-linked list per workspace for intelligent focus restoration on client unmanage, introduce configurable focus-follow delay (0-1000ms) for sloppy focus mode, and add demo mode timing parameters (step_delay, ai_timeout, window_timeout) with corresponding wait condition enum and configuration parsing in the [demo] section.
This commit is contained in:
2025-12-28 09:23:03 +00:00
parent 3364464b43
commit 64f9761116
31 changed files with 896 additions and 208 deletions
+19
View File
@@ -53,6 +53,7 @@ void config_set_defaults(Config *cfg)
strncpy(cfg->launcher, "dmenu_run", sizeof(cfg->launcher) - 1);
strncpy(cfg->file_manager, "thunar", sizeof(cfg->file_manager) - 1);
cfg->focus_mode = FOCUS_CLICK;
cfg->focus_follow_delay_ms = 100;
cfg->show_decorations = true;
cfg->border_width = DEFAULT_BORDER_WIDTH;
@@ -83,6 +84,10 @@ void config_set_defaults(Config *cfg)
strncpy(cfg->autostart_path, autostart_path, sizeof(cfg->autostart_path) - 1);
dwn_free(autostart_path);
}
cfg->demo_step_delay_ms = 4000;
cfg->demo_ai_timeout_ms = 15000;
cfg->demo_window_timeout_ms = 5000;
}
@@ -110,6 +115,9 @@ static void handle_config_entry(const char *section, const char *key,
} else {
cfg->focus_mode = FOCUS_CLICK;
}
} else if (strcmp(key, "focus_follow_delay") == 0) {
int val = atoi(value);
cfg->focus_follow_delay_ms = (val >= 0 && val <= 1000) ? val : 100;
} else if (strcmp(key, "decorations") == 0) {
cfg->show_decorations = (strcmp(value, "true") == 0 || strcmp(value, "1") == 0);
}
@@ -172,6 +180,17 @@ static void handle_config_entry(const char *section, const char *key,
dwn_free(expanded);
}
}
} else if (strcmp(section, "demo") == 0) {
if (strcmp(key, "step_delay") == 0) {
int val = atoi(value);
cfg->demo_step_delay_ms = (val >= 1000 && val <= 30000) ? val : 4000;
} else if (strcmp(key, "ai_timeout") == 0) {
int val = atoi(value);
cfg->demo_ai_timeout_ms = (val >= 5000 && val <= 60000) ? val : 15000;
} else if (strcmp(key, "window_timeout") == 0) {
int val = atoi(value);
cfg->demo_window_timeout_ms = (val >= 1000 && val <= 30000) ? val : 5000;
}
}
}