tui: defer resize event #2738

When maximizing the window, often only lines would be detected properly
with the `try_resize` handler being called immediately.

Fixes https://github.com/neovim/neovim/issues/2322.
This commit is contained in:
Daniel Hahler 2015-05-25 13:47:01 +02:00 committed by Justin M. Keyes
parent 8ce22c6323
commit 297973ab00

View File

@ -208,10 +208,11 @@ static void try_resize(Event ev)
static void sigwinch_cb(uv_signal_t *handle, int signum) static void sigwinch_cb(uv_signal_t *handle, int signum)
{ {
// Queue the event because resizing can result in recursive event_poll calls // Queue the event because resizing can result in recursive event_poll calls
// FIXME(blueyed): TUI does not resize properly when not deferred. Why? #2322
event_push((Event) { event_push((Event) {
.data = handle->data, .data = handle->data,
.handler = try_resize .handler = try_resize
}, false); }, true);
} }
static bool attrs_differ(HlAttrs a1, HlAttrs a2) static bool attrs_differ(HlAttrs a1, HlAttrs a2)