diff --git a/docs/changelog.rst b/docs/changelog.rst index 8ac3aff00..7549af5ae 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,7 +8,7 @@ To update |kitty|, :doc:`follow the instructions `. --------------------- - macOS: The default behavior of the Option key has changed. It now generates - unicode characters rather than acting as the Alt modifier. See + unicode characters rather than acting as the :kbd:`Alt` modifier. See :opt:`macos_option_as_alt`. - Support for an arbitrary number of internal clipboard buffers to copy/paste @@ -117,6 +117,9 @@ To update |kitty|, :doc:`follow the instructions `. - When encountering errors in :file:`kitty.conf` report them to the user instead of failing to start. +- Allow the user to control the resize debounce time via + :opt:`resize_debounce_time`. + 0.13.3 [2019-01-19] ------------------------------ diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index e2046d6a6..ade021cca 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -831,10 +831,10 @@ process_pending_resizes(double now) { if (w->live_resize.from_os_notification) { if (w->live_resize.os_says_resize_complete || (now - w->live_resize.last_resize_event_at) > 1) update_viewport = true; } else { - if (now - w->live_resize.last_resize_event_at >= RESIZE_DEBOUNCE_TIME) update_viewport = true; + if (now - w->live_resize.last_resize_event_at >= OPT(resize_debounce_time)) update_viewport = true; else { global_state.has_pending_resizes = true; - set_maximum_wait(RESIZE_DEBOUNCE_TIME - now + w->live_resize.last_resize_event_at); + set_maximum_wait(OPT(resize_debounce_time) - now + w->live_resize.last_resize_event_at); } } if (update_viewport) { diff --git a/kitty/config_data.py b/kitty/config_data.py index 264ee2a93..a0235a53d 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -603,6 +603,12 @@ Hide the window decorations (title-bar and window borders). Whether this works and exactly what effect it has depends on the window manager/operating system. ''')) + +o('resize_debounce_time', 0.1, option_type=positive_float, long_text=_(''' +The time (in seconds) to wait before redrawing the screen when a +resize event is received. On platforms such as macOS, where the +operating system sends event corresponding to the start and end +of a resize, this number is ignored.''')) # }}} g('tabbar') # {{{ diff --git a/kitty/state.c b/kitty/state.c index 434b61409..66b48b202 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -387,6 +387,7 @@ PYWRAP1(set_options) { S(open_url_modifiers, convert_mods); S(rectangle_select_modifiers, convert_mods); S(click_interval, PyFloat_AsDouble); + S(resize_debounce_time, PyFloat_AsDouble); S(url_color, color_as_int); S(background, color_as_int); S(foreground, color_as_int); diff --git a/kitty/state.h b/kitty/state.h index 75375e5a5..3a1278a1b 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -40,6 +40,7 @@ typedef struct { bool close_on_child_death; bool window_alert_on_bell; bool debug_keyboard; + double resize_debounce_time; } Options; typedef struct { @@ -178,8 +179,6 @@ extern GlobalState global_state; else Py_DECREF(cret_); \ } -#define RESIZE_DEBOUNCE_TIME 0.2 - void gl_init(); void remove_vao(ssize_t vao_idx); bool remove_os_window(id_type os_window_id);