diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-08-03 20:13:29 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-08-03 20:13:29 +0200 |
commit | 8137c2cf9af986d1da1ed2c2e767668236f9cb6e (patch) | |
tree | 29974a8a0354ab9e1ba1de1d534432345d8e9380 /src | |
parent | 24606993437b7ec71d42fb038024077245f1b95f (diff) | |
download | weechat-8137c2cf9af986d1da1ed2c2e767668236f9cb6e.zip |
core: fix crash with "/input grab_mouse"
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/curses/gui-curses-mouse.c | 26 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk.h | 1 | ||||
-rw-r--r-- | src/gui/gui-key.h | 1 |
3 files changed, 2 insertions, 26 deletions
diff --git a/src/gui/curses/gui-curses-mouse.c b/src/gui/curses/gui-curses-mouse.c index 8e0713c47..2e1a40436 100644 --- a/src/gui/curses/gui-curses-mouse.c +++ b/src/gui/curses/gui-curses-mouse.c @@ -203,21 +203,16 @@ gui_mouse_event_init () /* * gui_mouse_event_code2key: get key name with a mouse code - * *extra_chars is set with first char following the - * end of mouse code (this can point to the '\0' or - * other chars) */ const char * -gui_mouse_event_code2key (const char *code, char **extra_chars) +gui_mouse_event_code2key (const char *code) { int x, y, code_utf8, length; double diff_x, diff_y, distance, angle, pi4; static char key[128]; char button[2], *ptr_code; - *extra_chars = NULL; - key[0] = '\0'; /* @@ -238,14 +233,12 @@ gui_mouse_event_code2key (const char *code, char **extra_chars) if (!ptr_code) return NULL; y = utf8_char_int (ptr_code) - 33; - *extra_chars = utf8_next_char (ptr_code); } else { /* get coordinates using ISO chars in code */ x = ((unsigned char)code[1]) - 33; y = ((unsigned char)code[2]) - 33; - *extra_chars = (char *)code + 3; } if (x < 0) x = 0; @@ -393,8 +386,6 @@ void gui_mouse_event_end () { const char *mouse_key; - char *extra_chars; - int i; gui_mouse_event_pending = 0; @@ -406,7 +397,7 @@ gui_mouse_event_end () } /* get key from mouse code */ - mouse_key = gui_mouse_event_code2key (gui_key_combo_buffer, &extra_chars); + mouse_key = gui_mouse_event_code2key (gui_key_combo_buffer); if (mouse_key && mouse_key[0]) { if (gui_mouse_grab) @@ -423,17 +414,4 @@ gui_mouse_event_end () } gui_key_combo_buffer[0] = '\0'; - - /* - * if extra chars, use them as new input (this can happen if used typed - * something and that mouse timer was not reached yet - */ - if (extra_chars && extra_chars[0]) - { - for (i = 0; extra_chars[i]; i++) - { - gui_key_buffer_add ((unsigned char)extra_chars[i]); - } - gui_key_flush (); - } } diff --git a/src/gui/gtk/gui-gtk.h b/src/gui/gtk/gui-gtk.h index 69cd4daa3..5265c91fe 100644 --- a/src/gui/gtk/gui-gtk.h +++ b/src/gui/gtk/gui-gtk.h @@ -101,7 +101,6 @@ extern void gui_chat_calculate_line_diff (struct t_gui_window *window, /* key functions */ extern void gui_key_default_bindings (int context); extern void gui_key_read (); -extern void gui_key_flush (); /* window functions */ extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer); diff --git a/src/gui/gui-key.h b/src/gui/gui-key.h index da200c354..c1f3ffd1c 100644 --- a/src/gui/gui-key.h +++ b/src/gui/gui-key.h @@ -105,6 +105,5 @@ extern void gui_key_print_log (struct t_gui_buffer *buffer); /* key functions (GUI dependent) */ extern void gui_key_default_bindings (); -extern void gui_key_flush (); #endif /* __WEECHAT_GUI_KEY_H */ |