From f765bbf9c4c6cf287329938733ee4c09406a1098 Mon Sep 17 00:00:00 2001 From: Giovanni Panozzo Date: Sun, 7 Dec 2014 10:45:35 +0100 Subject: [PATCH] Added missing ifdef HAVE_LIBVTE, fixes #394 --- remmina/src/remmina_connection_window.c | 16 ++++++++-------- remmina/src/remmina_masterthread_exec.c | 4 ++++ remmina/src/remmina_masterthread_exec.h | 4 ++++ remmina/src/remmina_ssh_plugin.h | 4 ++++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/remmina/src/remmina_connection_window.c b/remmina/src/remmina_connection_window.c index 5f1311c277..65f3786c05 100644 --- a/remmina/src/remmina_connection_window.c +++ b/remmina/src/remmina_connection_window.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, + * Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * In addition, as a special exception, the copyright holders give @@ -197,12 +197,12 @@ static void remmina_connection_holder_keyboard_grab(RemminaConnectionHolder* cnn if (keyboard != NULL) { - + if ( gdk_device_get_source (keyboard) != GDK_SOURCE_KEYBOARD) { keyboard = gdk_device_get_associated_device( keyboard ); } - + if (remmina_file_get_int(cnnobj->remmina_file, "keyboard_grab", FALSE)) { gdk_device_grab(keyboard, gtk_widget_get_window(GTK_WIDGET(cnnhld->cnnwin)), GDK_OWNERSHIP_WINDOW, TRUE, GDK_KEY_PRESS | GDK_KEY_RELEASE, NULL, GDK_CURRENT_TIME); @@ -1550,7 +1550,7 @@ static gboolean remmina_connection_window_on_leave(GtkWidget* widget, GdkEventCr GdkDisplay *display; GdkDeviceManager *manager; GdkDevice *device = NULL; - + if (event->detail == GDK_NOTIFY_VIRTUAL || event->detail == GDK_NOTIFY_NONLINEAR || event->detail == GDK_NOTIFY_NONLINEAR_VIRTUAL) { @@ -1972,7 +1972,7 @@ static void remmina_connection_window_initialize_notebook(GtkNotebook* to, GtkNo tab = remmina_connection_object_create_tab(cnnobj); remmina_connection_object_append_page(cnnobj, to, tab, view_mode); -#if GTK_VERSION == 3 +#if GTK_VERSION == 3 /* Reparent cnnobj->viewport */ g_object_ref(cnnobj->viewport); gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(cnnobj->viewport)), cnnobj->viewport); @@ -2001,7 +2001,7 @@ static void remmina_connection_window_initialize_notebook(GtkNotebook* to, GtkNo tab = remmina_connection_object_create_tab(cnnobj); remmina_connection_object_append_page(cnnobj, to, tab, view_mode); -#if GTK_VERSION == 3 +#if GTK_VERSION == 3 /* Reparent cnnobj->viewport */ g_object_ref(cnnobj->viewport); gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(cnnobj->viewport)), cnnobj->viewport); @@ -2508,8 +2508,8 @@ static void remmina_connection_object_on_connect(RemminaProtocolWidget* gp, Remm tab = remmina_connection_object_create_tab(cnnobj); i = remmina_connection_object_append_page(cnnobj, GTK_NOTEBOOK(cnnhld->cnnwin->priv->notebook), tab, cnnhld->cnnwin->priv->view_mode); - -#if GTK_VERSION == 3 + +#if GTK_VERSION == 3 /* Reparent cnnobj->viewport */ g_object_ref(cnnobj->viewport); gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(cnnobj->viewport)), cnnobj->viewport); diff --git a/remmina/src/remmina_masterthread_exec.c b/remmina/src/remmina_masterthread_exec.c index d86485e35e..9b6fce4458 100644 --- a/remmina/src/remmina_masterthread_exec.c +++ b/remmina/src/remmina_masterthread_exec.c @@ -97,12 +97,16 @@ static gboolean remmina_masterthread_exec_callback(RemminaMTExecData *d) d->p.ftp_client_get_waiting_task.retval = remmina_ftp_client_get_waiting_task( d->p.ftp_client_get_waiting_task.client ); 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, d->p.sftp_client_confirm_resume.path ); +#endif break; case FUNC_VTE_TERMINAL_SET_ENCODING_AND_PTY: +#if defined (HAVE_LIBSSH) && defined (HAVE_LIBVTE) remmina_plugin_ssh_vte_terminal_set_encoding_and_pty( d->p.vte_terminal_set_encoding_and_pty.terminal, d->p.vte_terminal_set_encoding_and_pty.codeset, d->p.vte_terminal_set_encoding_and_pty.pty ); +#endif break; } pthread_mutex_unlock(&d->mu); diff --git a/remmina/src/remmina_masterthread_exec.h b/remmina/src/remmina_masterthread_exec.h index 01d6cb9779..7a40e6f54b 100644 --- a/remmina/src/remmina_masterthread_exec.h +++ b/remmina/src/remmina_masterthread_exec.h @@ -117,16 +117,20 @@ typedef struct remmina_masterthread_exec_data { RemminaFTPClient *client; RemminaFTPTask* retval; } ftp_client_get_waiting_task; +#if defined (HAVE_LIBSSH) && defined (HAVE_LIBVTE) struct { RemminaSFTPClient *client; const gchar *path; gint retval; } sftp_client_confirm_resume; +#endif +#ifdef HAVE_LIBVTE struct { VteTerminal *terminal; const char *codeset; VtePty *pty; } vte_terminal_set_encoding_and_pty; +#endif } p; /* Mutex for thread synchronization */ diff --git a/remmina/src/remmina_ssh_plugin.h b/remmina/src/remmina_ssh_plugin.h index 18502d4330..d43811406a 100644 --- a/remmina/src/remmina_ssh_plugin.h +++ b/remmina/src/remmina_ssh_plugin.h @@ -35,14 +35,18 @@ #ifndef __REMMINASSHPLUGIN_H__ #define __REMMINASSHPLUGIN_H__ +#ifdef HAVE_LIBVTE #include +#endif G_BEGIN_DECLS void remmina_ssh_plugin_register(void); /* For callback in main thread */ +#if defined (HAVE_LIBSSH) && defined (HAVE_LIBVTE) void remmina_plugin_ssh_vte_terminal_set_encoding_and_pty(VteTerminal *terminal, const char *codeset, VtePty *pty); +#endif G_END_DECLS