diff options
author | Giovanni Panozzo <giovanni@panozzo.it> | 2019-01-30 00:29:32 +0300 |
---|---|---|
committer | Giovanni Panozzo <giovanni@panozzo.it> | 2019-01-30 00:29:32 +0300 |
commit | c9f2d49822c2d1a6d45fe186baba8d02e8e84980 (patch) | |
tree | 222ffda93ce23364de93ab5108d81fd0a275aea8 /src | |
parent | a759c48ffcedda35593c5159e5c574722378a98b (diff) |
Fix a couple of VNCI crashes, see issue #1821
Diffstat (limited to 'src')
-rw-r--r-- | src/remmina_connection_window.c | 2 | ||||
-rw-r--r-- | src/remmina_masterthread_exec.c | 3 | ||||
-rw-r--r-- | src/remmina_masterthread_exec.h | 5 | ||||
-rw-r--r-- | src/remmina_protocol_widget.c | 12 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/remmina_connection_window.c b/src/remmina_connection_window.c index 5b2171b57..15bf97b06 100644 --- a/src/remmina_connection_window.c +++ b/src/remmina_connection_window.c @@ -3572,7 +3572,7 @@ static RemminaConnectionWindow* remmina_connection_window_find(RemminaFile* remm static gboolean remmina_connection_object_delayed_window_present(gpointer user_data) { RemminaConnectionObject* cnnobj = (RemminaConnectionObject*)user_data; - if (cnnobj && cnnobj->cnnhld && cnnobj->cnnhld->cnnwin) { + if (cnnobj && cnnobj->connected && cnnobj->cnnhld && cnnobj->cnnhld->cnnwin) { gtk_window_present_with_time(GTK_WINDOW(cnnobj->cnnhld->cnnwin), (guint32)(g_get_monotonic_time() / 1000)); remmina_connection_holder_grab_focus(GTK_NOTEBOOK(cnnobj->cnnhld->cnnwin->priv->notebook)); } diff --git a/src/remmina_masterthread_exec.c b/src/remmina_masterthread_exec.c index fab7bb784..a13c8bd35 100644 --- a/src/remmina_masterthread_exec.c +++ b/src/remmina_masterthread_exec.c @@ -82,6 +82,9 @@ static gboolean remmina_masterthread_exec_callback(RemminaMTExecData *d) case FUNC_PROTOCOLWIDGET_MPSHOWRETRY: remmina_protocol_widget_panel_show_retry(d->p.protocolwidget_mpshowretry.gp); break; + case FUNC_PROTOCOLWIDGET_PANELSHOWLISTEN: + remmina_protocol_widget_panel_show_listen(d->p.protocolwidget_panelshowlisten.gp, d->p.protocolwidget_panelshowlisten.port); + break; case FUNC_SFTP_CLIENT_CONFIRM_RESUME: #ifdef HAVE_LIBSSH d->p.sftp_client_confirm_resume.retval = remmina_sftp_client_confirm_resume( d->p.sftp_client_confirm_resume.client, diff --git a/src/remmina_masterthread_exec.h b/src/remmina_masterthread_exec.h index 324e79091..88b673582 100644 --- a/src/remmina_masterthread_exec.h +++ b/src/remmina_masterthread_exec.h @@ -50,6 +50,7 @@ typedef struct remmina_masterthread_exec_data { FUNC_PROTOCOLWIDGET_MPPROGRESS, FUNC_PROTOCOLWIDGET_MPDESTROY, FUNC_PROTOCOLWIDGET_MPSHOWRETRY, + FUNC_PROTOCOLWIDGET_PANELSHOWLISTEN, FUNC_VTE_TERMINAL_SET_ENCODING_AND_PTY } func; @@ -96,6 +97,10 @@ typedef struct remmina_masterthread_exec_data { struct { RemminaProtocolWidget *gp; } protocolwidget_mpshowretry; + struct { + RemminaProtocolWidget *gp; + int port; + } protocolwidget_panelshowlisten; #ifdef HAVE_LIBSSH struct { RemminaSFTPClient *client; diff --git a/src/remmina_protocol_widget.c b/src/remmina_protocol_widget.c index eff3c4664..e56d71470 100644 --- a/src/remmina_protocol_widget.c +++ b/src/remmina_protocol_widget.c @@ -1490,6 +1490,18 @@ void remmina_protocol_widget_panel_show_listen(RemminaProtocolWidget* gp, gint p RemminaMessagePanel *mp; gchar* s; + if ( !remmina_masterthread_exec_is_main_thread() ) { + /* Allow the execution of this function from a non main thread */ + RemminaMTExecData *d; + d = (RemminaMTExecData*)g_malloc( sizeof(RemminaMTExecData) ); + d->func = FUNC_PROTOCOLWIDGET_PANELSHOWLISTEN; + d->p.protocolwidget_panelshowlisten.gp = gp; + d->p.protocolwidget_panelshowlisten.port = port; + remmina_masterthread_exec_and_wait(d); + g_free(d); + return; + } + mp = remmina_message_panel_new(); s = g_strdup_printf( _("Listening on port %i for an incoming %s connection…"), port, |