diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-24 11:31:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-24 11:31:07 +0800 |
commit | 53cc835b51546f9ff68facebab2e0c6e97585e5b (patch) | |
tree | 644501c1668806cde81dc83735e15608155731ab /src | |
parent | 55dbf5c3798cde8f9bfd36cd17dce636f6f6ea08 (diff) | |
download | rneovim-53cc835b51546f9ff68facebab2e0c6e97585e5b.tar.gz rneovim-53cc835b51546f9ff68facebab2e0c6e97585e5b.tar.bz2 rneovim-53cc835b51546f9ff68facebab2e0c6e97585e5b.zip |
refactor(tui): remove unnecessary scheduling when suspending (#26190)
Nvim no longer calls loop_poll_events() when suspending, so it isn't
necessary to schedule suspend_event.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/tui/tui.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 90309b6600..323227d4c0 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -15,9 +15,7 @@ #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/cursor_shape.h" -#include "nvim/event/defs.h" #include "nvim/event/loop.h" -#include "nvim/event/multiqueue.h" #include "nvim/event/signal.h" #include "nvim/event/stream.h" #include "nvim/globals.h" @@ -36,7 +34,6 @@ #include "nvim/tui/tui.h" #include "nvim/types.h" #include "nvim/ugrid.h" -#include "nvim/ui.h" #include "nvim/ui_client.h" #ifdef MSWIN @@ -1424,10 +1421,10 @@ static void show_verbose_terminfo(TUIData *tui) api_free_array(args); } -#ifdef UNIX -static void suspend_event(void **argv) +void tui_suspend(TUIData *tui) { - TUIData *tui = argv[0]; +// on a non-UNIX system, this is a no-op +#ifdef UNIX ui_client_detach(); bool enable_mouse = tui->mouse_enabled; tui_terminal_stop(tui); @@ -1442,18 +1439,6 @@ static void suspend_event(void **argv) } stream_set_blocking(tui->input.in_fd, false); // libuv expects this ui_client_attach(tui->width, tui->height, tui->term); -} -#endif - -void tui_suspend(TUIData *tui) -{ -// on a non-UNIX system, this is a no-op -#ifdef UNIX - // kill(0, SIGTSTP) won't stop the UI thread, so we must poll for SIGCONT - // before continuing. This is done in another callback to avoid - // loop_poll_events recursion - multiqueue_put_event(resize_events, - event_create(suspend_event, 1, tui)); #endif } |