Allow the user to control the draw strategy during OS window resizes
Changed the default to scaled which matches current macOS behavior. Fixes #1591
This commit is contained in:
parent
a3f9835b7b
commit
9b740849ed
5 changed files with 23 additions and 5 deletions
|
|
@ -34,8 +34,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||
- Allow specifying a value of ``none`` for the :opt:`selection_foreground`
|
||||
which will cause kitty to not change text color in selections (:iss:`1358`)
|
||||
|
||||
- Make live resizing of OS windows smoother and show the size in cells
|
||||
while the resize is in progress.
|
||||
- Make live resizing of OS windows smoother and add an option
|
||||
:opt:`resize_draw_strategy` to control what is drawn while a
|
||||
resize is in progress.
|
||||
|
||||
- macOS: Improve handling of IME extended input. Compose characters
|
||||
are now highlighted and the IME panel moves along with the text
|
||||
|
|
|
|||
|
|
@ -684,14 +684,14 @@ render(double now) {
|
|||
continue;
|
||||
}
|
||||
make_os_window_context_current(w);
|
||||
if (w->live_resize.in_progress) {
|
||||
if (OPT(resize_draw_strategy) != RESIZE_DRAW_SCALED && w->live_resize.in_progress) {
|
||||
blank_os_window(w);
|
||||
draw_resizing_text(w);
|
||||
if (OPT(resize_draw_strategy) == RESIZE_DRAW_SIZE) draw_resizing_text(w);
|
||||
swap_window_buffers(w);
|
||||
if (USE_RENDER_FRAMES) request_frame_render(w);
|
||||
continue;
|
||||
}
|
||||
bool needs_render = w->is_damaged;
|
||||
bool needs_render = w->is_damaged || w->live_resize.in_progress;
|
||||
if (w->viewport_size_dirty) {
|
||||
w->clear_count = 0;
|
||||
update_surface_size(w->viewport_width, w->viewport_height, w->offscreen_texture_id);
|
||||
|
|
|
|||
|
|
@ -609,6 +609,20 @@ def to_layout_names(raw):
|
|||
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.'''))
|
||||
|
||||
|
||||
def resize_draw_strategy(x):
|
||||
cmap = {'scale': 0, 'blank': 1, 'size': 2}
|
||||
return cmap.get(x.lower(), 0)
|
||||
|
||||
|
||||
o('resize_draw_strategy', 'scale', option_type=resize_draw_strategy, long_text=_('''
|
||||
Choose how kitty draws a window while a resize is in progress. A
|
||||
value of :code:`scale` means draw the current window contents scaled.
|
||||
A value of :code:`blank` means draw a blank window.
|
||||
A value of :code:`size` means show the window size in cells.
|
||||
'''))
|
||||
|
||||
# }}}
|
||||
|
||||
g('tabbar') # {{{
|
||||
|
|
|
|||
|
|
@ -410,6 +410,7 @@ PYWRAP1(set_options) {
|
|||
S(macos_thicken_font, PyFloat_AsDouble);
|
||||
S(tab_bar_min_tabs, PyLong_AsUnsignedLong);
|
||||
S(disable_ligatures, PyLong_AsLong);
|
||||
S(resize_draw_strategy, PyLong_AsLong);
|
||||
|
||||
GA(tab_bar_style);
|
||||
global_state.tab_bar_hidden = PyUnicode_CompareWithASCIIString(ret, "hidden") == 0 ? true: false;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#define OPT(name) global_state.opts.name
|
||||
|
||||
typedef enum { LEFT_EDGE, TOP_EDGE, RIGHT_EDGE, BOTTOM_EDGE } Edge;
|
||||
typedef enum { RESIZE_DRAW_SCALED, RESIZE_DRAW_BLANK, RESIZE_DRAW_SIZE } ResizeDrawStrategy;
|
||||
|
||||
typedef struct {
|
||||
double visual_bell_duration, cursor_blink_interval, cursor_stop_blinking_after, mouse_hide_wait, click_interval, wheel_scroll_multiplier, touch_scroll_multiplier;
|
||||
|
|
@ -36,6 +37,7 @@ typedef struct {
|
|||
Edge tab_bar_edge;
|
||||
unsigned long tab_bar_min_tabs;
|
||||
DisableLigature disable_ligatures;
|
||||
ResizeDrawStrategy resize_draw_strategy;
|
||||
bool sync_to_monitor;
|
||||
bool close_on_child_death;
|
||||
bool window_alert_on_bell;
|
||||
|
|
|
|||
Loading…
Reference in a new issue