From 9a1df7bb036cffbef206a3f2dbe46559b6f15d89 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 17 Jan 2021 16:12:54 +0100 Subject: render: delay TIOCSWINSZ while doing an interactive resize Instead of disabling content centering, delay the TIOCSWINSZ (a.k.a delay sending the new dimensions to the client) by a small amount while doing an interactive resize. Non-interactive resizes are still immediate. For now, force a resize when the user stops the interactive resize. This ensures the client application receives the new dimensions immediately. It still works without the last, forced, resize, but there typically be a small delay until the client application receives the final dimensions. Closes #301 Closes #283 --- config.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index 81b329cf..7c6b6148 100644 --- a/config.c +++ b/config.c @@ -1745,6 +1745,19 @@ parse_section_tweak( conf->tweak.box_drawing_base_thickness); } + else if (strcmp(key, "resize-delay-ms") == 0) { + unsigned long ms; + if (!str_to_ulong(value, 10, &ms)) { + LOG_AND_NOTIFY_ERR( + "%s:%d: [tweak]: resize-delay-ms: expected an integer, got '%s'", + path, lineno, value); + return false; + } + + conf->tweak.resize_delay_ms = ms; + LOG_WARN("tweak: resize-delay-ms=%hu", conf->tweak.resize_delay_ms); + } + else { LOG_AND_NOTIFY_ERR("%s:%u: [tweak]: %s: invalid key", path, lineno, key); return false; @@ -2166,6 +2179,7 @@ config_load(struct config *conf, const char *conf_path, .render_timer_log = false, .damage_whole_window = false, .box_drawing_base_thickness = 0.04, + .resize_delay_ms = 100, }, .notifications = tll_init(), -- cgit v1.3