From 956befb65532aa019aac5608cb867f209f58fe45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 6 Oct 2024 20:57:54 +0200 Subject: [PATCH] core: always send the signal "buffer_switch", even when the buffer is opening (issue #2198) --- CHANGELOG.md | 1 + src/gui/gui-buffer.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 050e13a2e..ab5e4f0e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - irc: fix crash on /list buffer when a filter is set ([#2197](https://github.com/weechat/weechat/issues/2197)) +- core: always send the signal "buffer_switch", even when the buffer is opening ([#2198](https://github.com/weechat/weechat/issues/2198)) - core: fix build on Android ([#2180](https://github.com/weechat/weechat/issues/2180)) ## Version 4.4.2 (2024-09-08) diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index bb8ef4596..457967fe3 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -184,7 +184,8 @@ gui_buffer_search_notify (const char *notify) } /* - * Sends a buffer signal (only if the buffer is completely opened. + * Sends a buffer signal, only if the buffer is completely opened or if + * the signal is "buffer_switch". */ int @@ -192,8 +193,10 @@ gui_buffer_send_signal (struct t_gui_buffer *buffer, const char *signal, const char *type_data, void *signal_data) { - return (buffer->opening) ? - WEECHAT_RC_OK : hook_signal_send (signal, type_data, signal_data); + if (buffer->opening && (string_strcmp (signal, "buffer_switch") != 0)) + return WEECHAT_RC_OK; + + return hook_signal_send (signal, type_data, signal_data); } /*