summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc7
-rw-r--r--src/gui/curses/gui-curses-key.c12
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 8ccff004e..235cc9ca2 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -15,6 +15,13 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
(file _ReleaseNotes.adoc_ in sources).
+[[v2.3]]
+== Version 2.3 (under dev)
+
+Bug fixes::
+
+ * core: send signal "key_pressed" for mouse code only if the string is UTF-8 valid (issue #1220)
+
[[v2.2]]
== Version 2.2 (2018-07-14)
diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c
index d7d6c1e17..66a8bc010 100644
--- a/src/gui/curses/gui-curses-key.c
+++ b/src/gui/curses/gui-curses-key.c
@@ -408,8 +408,16 @@ gui_key_flush (int paste)
if (key_str[0])
{
- (void) hook_signal_send ("key_pressed",
- WEECHAT_HOOK_SIGNAL_STRING, key_str);
+ /*
+ * send the signal "key_pressed" only if NOT reading a mouse event
+ * or if the mouse code is valid UTF-8 (do not send partial mouse
+ * code which is not UTF-8 valid)
+ */
+ if (!gui_mouse_event_pending || utf8_is_valid (key_str, -1, NULL))
+ {
+ (void) hook_signal_send ("key_pressed",
+ WEECHAT_HOOK_SIGNAL_STRING, key_str);
+ }
if (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
input_old = (gui_current_window->buffer->input_buffer) ?