From 7b3f37725fac33affe6d013c69f9b59bb140d5c8 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Wed, 15 Apr 2026 14:34:37 +0200 Subject: [PATCH] rcxml: add raiseOnFocusDelay option Add a new element accepting an integer in milliseconds. The default of 0 preserves the current behavior (raise immediately when raiseOnFocus is enabled). The new field is carried as uint32_t raise_on_focus_delay_ms on struct rcxml. This commit only adds the parser and default; the actual delay logic follows in a subsequent commit. --- include/config/rcxml.h | 1 + src/config/rcxml.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 8a2c606c..3ef7bd67 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -90,6 +90,7 @@ struct rcxml { bool focus_follow_mouse; bool focus_follow_mouse_requires_movement; bool raise_on_focus; + uint32_t raise_on_focus_delay_ms; /* theme */ char *theme_name; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index e3187af2..d0bb76db 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -1195,6 +1195,9 @@ entry(xmlNode *node, char *nodename, char *content) set_bool(content, &rc.focus_follow_mouse_requires_movement); } else if (!strcasecmp(nodename, "raiseOnFocus.focus")) { set_bool(content, &rc.raise_on_focus); + } else if (!strcasecmp(nodename, "raiseOnFocusDelay.focus")) { + long val = strtol(content, NULL, 10); + rc.raise_on_focus_delay_ms = val > 0 ? (uint32_t)val : 0; } else if (!strcasecmp(nodename, "doubleClickTime.mouse")) { long doubleclick_time_parsed = strtol(content, NULL, 10); if (doubleclick_time_parsed > 0) { @@ -1530,6 +1533,7 @@ rcxml_init(void) rc.focus_follow_mouse = false; rc.focus_follow_mouse_requires_movement = true; rc.raise_on_focus = false; + rc.raise_on_focus_delay_ms = 0; rc.doubleclick_time = 500;