GUAC-1389: Do not handle input events until terminal exists.

This commit is contained in:
Michael Jumper 2016-03-14 20:05:45 -07:00
parent 4faf1829d2
commit 9253d877a2

View File

@ -41,6 +41,10 @@ int guac_telnet_user_mouse_handler(guac_user* user, int x, int y, int mask) {
guac_telnet_settings* settings = telnet_client->settings; guac_telnet_settings* settings = telnet_client->settings;
guac_terminal* term = telnet_client->term; guac_terminal* term = telnet_client->term;
/* Skip if terminal not yet ready */
if (term == NULL)
return 0;
/* Send mouse if not searching for password or username */ /* Send mouse if not searching for password or username */
if (settings->password_regex == NULL && settings->username_regex == NULL) if (settings->password_regex == NULL && settings->username_regex == NULL)
guac_terminal_send_mouse(term, user, x, y, mask); guac_terminal_send_mouse(term, user, x, y, mask);
@ -56,6 +60,10 @@ int guac_telnet_user_key_handler(guac_user* user, int keysym, int pressed) {
guac_telnet_settings* settings = telnet_client->settings; guac_telnet_settings* settings = telnet_client->settings;
guac_terminal* term = telnet_client->term; guac_terminal* term = telnet_client->term;
/* Skip if terminal not yet ready */
if (term == NULL)
return 0;
/* Stop searching for password */ /* Stop searching for password */
if (settings->password_regex != NULL) { if (settings->password_regex != NULL) {
@ -107,6 +115,10 @@ int guac_telnet_user_size_handler(guac_user* user, int width, int height) {
guac_telnet_client* telnet_client = (guac_telnet_client*) client->data; guac_telnet_client* telnet_client = (guac_telnet_client*) client->data;
guac_terminal* terminal = telnet_client->term; guac_terminal* terminal = telnet_client->term;
/* Skip if terminal not yet ready */
if (terminal == NULL)
return 0;
/* Resize terminal */ /* Resize terminal */
guac_terminal_resize(terminal, width, height); guac_terminal_resize(terminal, width, height);