diff options
-rw-r--r-- | plugins/nx/nx_plugin.c | 2 | ||||
-rw-r--r-- | plugins/spice/spice_plugin.c | 180 | ||||
-rw-r--r-- | plugins/st/st_plugin.c | 21 | ||||
-rw-r--r-- | plugins/xdmcp/xdmcp_plugin.c | 2 | ||||
-rw-r--r-- | src/include/remmina/types.h | 3 | ||||
-rw-r--r-- | src/remmina_connection_window.c | 21 | ||||
-rw-r--r-- | src/remmina_plugin_manager.c | 12 |
7 files changed, 44 insertions, 197 deletions
diff --git a/plugins/nx/nx_plugin.c b/plugins/nx/nx_plugin.c index f4af62963..d617b8672 100644 --- a/plugins/nx/nx_plugin.c +++ b/plugins/nx/nx_plugin.c @@ -48,6 +48,7 @@ #include "nx_session_manager.h" #define REMMINA_PLUGIN_NX_FEATURE_TOOL_SENDCTRLALTDEL 1 +#define REMMINA_PLUGIN_NX_FEATURE_GTKSOCKET 1 /* Forward declaration */ static RemminaProtocolPlugin remmina_plugin_nx; @@ -725,6 +726,7 @@ static const RemminaProtocolSetting remmina_plugin_nx_advanced_settings[] = static const RemminaProtocolFeature remmina_plugin_nx_features[] = { { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_NX_FEATURE_TOOL_SENDCTRLALTDEL, N_("Send Ctrl+Alt+Delete"), NULL, NULL }, + { REMMINA_PROTOCOL_FEATURE_TYPE_GTKSOCKET, REMMINA_PLUGIN_NX_FEATURE_GTKSOCKET, NULL, NULL, NULL}, { REMMINA_PROTOCOL_FEATURE_TYPE_END, 0, NULL, NULL, NULL } }; diff --git a/plugins/spice/spice_plugin.c b/plugins/spice/spice_plugin.c index 61a5bf816..771daa216 100644 --- a/plugins/spice/spice_plugin.c +++ b/plugins/spice/spice_plugin.c @@ -41,18 +41,6 @@ enum { REMMINA_PLUGIN_SPICE_FEATURE_PREF_RESIZEGUEST, REMMINA_PLUGIN_SPICE_FEATURE_PREF_DISABLECLIPBOARD, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTDEL, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF1, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF2, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF3, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF4, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF5, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF6, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF7, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF8, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF9, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF10, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF11, - REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF12, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_USBREDIR, REMMINA_PLUGIN_SPICE_FEATURE_SCALE }; @@ -350,126 +338,6 @@ static void remmina_plugin_spice_send_ctrlaltdel(RemminaProtocolWidget *gp) remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); } -/* Send CTRL+ALT+F1 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf1(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F1 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F2 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf2(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F2 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F3 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf3(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F3 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F4 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf4(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F4 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F5 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf5(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F5 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F6 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf6(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F6 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F7 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf7(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F7 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F8 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf8(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F8 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F9 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf9(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F9 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F10 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf10(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F10 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F11 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf11(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F11 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - -/* Send CTRL+ALT+F12 keys keystrokes to the plugin socket widget */ -static void remmina_plugin_spice_send_ctrlaltf12(RemminaProtocolWidget *gp) -{ - TRACE_CALL(__func__); - - guint keys[] = { GDK_KEY_Control_L, GDK_KEY_Alt_L, GDK_KEY_F12 }; - - remmina_plugin_spice_keystroke(gp, keys, G_N_ELEMENTS(keys)); -} - static void remmina_plugin_spice_update_scale(RemminaProtocolWidget *gp) { TRACE_CALL(__func__); @@ -533,42 +401,6 @@ static void remmina_plugin_spice_call_feature(RemminaProtocolWidget *gp, const R case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTDEL: remmina_plugin_spice_send_ctrlaltdel(gp); break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF1: - remmina_plugin_spice_send_ctrlaltf1(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF2: - remmina_plugin_spice_send_ctrlaltf2(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF3: - remmina_plugin_spice_send_ctrlaltf3(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF4: - remmina_plugin_spice_send_ctrlaltf4(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF5: - remmina_plugin_spice_send_ctrlaltf5(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF6: - remmina_plugin_spice_send_ctrlaltf6(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF7: - remmina_plugin_spice_send_ctrlaltf7(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF8: - remmina_plugin_spice_send_ctrlaltf8(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF9: - remmina_plugin_spice_send_ctrlaltf9(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF10: - remmina_plugin_spice_send_ctrlaltf10(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF11: - remmina_plugin_spice_send_ctrlaltf11(gp); - break; - case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF12: - remmina_plugin_spice_send_ctrlaltf12(gp); - break; case REMMINA_PLUGIN_SPICE_FEATURE_TOOL_USBREDIR: remmina_plugin_spice_select_usb_devices(gp); break; @@ -625,18 +457,6 @@ static const RemminaProtocolFeature remmina_plugin_spice_features[] = { REMMINA_PROTOCOL_FEATURE_TYPE_PREF, REMMINA_PLUGIN_SPICE_FEATURE_PREF_RESIZEGUEST, GINT_TO_POINTER(REMMINA_PROTOCOL_FEATURE_PREF_CHECK), "resizeguest", N_("Resize guest to match window size")}, { REMMINA_PROTOCOL_FEATURE_TYPE_PREF, REMMINA_PLUGIN_SPICE_FEATURE_PREF_DISABLECLIPBOARD, GINT_TO_POINTER(REMMINA_PROTOCOL_FEATURE_PREF_CHECK), "disableclipboard", N_("Disable clipboard sync")}, { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTDEL, N_("Send Ctrl+Alt+Delete"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF1, N_("Send Ctrl+Alt+F1"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF2, N_("Send Ctrl+Alt+F2"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF3, N_("Send Ctrl+Alt+F3"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF4, N_("Send Ctrl+Alt+F4"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF5, N_("Send Ctrl+Alt+F5"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF6, N_("Send Ctrl+Alt+F6"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF7, N_("Send Ctrl+Alt+F7"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF8, N_("Send Ctrl+Alt+F8"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF9, N_("Send Ctrl+Alt+F9"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF10, N_("Send Ctrl+Alt+F10"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF11, N_("Send Ctrl+Alt+F11"), NULL, NULL}, - { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_SENDCTRLALTF12, N_("Send Ctrl+Alt+F12"), NULL, NULL}, { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_SPICE_FEATURE_TOOL_USBREDIR, N_("Select USB devices for redirection"), NULL, NULL}, { REMMINA_PROTOCOL_FEATURE_TYPE_SCALE, REMMINA_PLUGIN_SPICE_FEATURE_SCALE, NULL, NULL, NULL}, { REMMINA_PROTOCOL_FEATURE_TYPE_END, 0, NULL, NULL, NULL} diff --git a/plugins/st/st_plugin.c b/plugins/st/st_plugin.c index f34ed92ac..1af811eee 100644 --- a/plugins/st/st_plugin.c +++ b/plugins/st/st_plugin.c @@ -44,6 +44,8 @@ #include <sys/wait.h> #include <unistd.h> +#define REMMINA_PLUGIN_ST_FEATURE_GTKSOCKET 1 + typedef struct _RemminaPluginData { GtkWidget *socket; @@ -53,6 +55,13 @@ typedef struct _RemminaPluginData static RemminaPluginService *remmina_plugin_service = NULL; +static gboolean remmina_st_query_feature(RemminaProtocolWidget* gp, const RemminaProtocolFeature* feature) +{ + TRACE_CALL(__func__); + return TRUE; +} + + static void remmina_plugin_st_on_plug_added(GtkSocket *socket, RemminaProtocolWidget *gp) { TRACE_CALL(__func__); @@ -245,6 +254,14 @@ static const RemminaProtocolSetting remmina_plugin_st_advanced_settings[] = { REMMINA_PROTOCOL_SETTING_TYPE_END, NULL, NULL, FALSE, NULL, NULL } }; +/* Array for available features. + * The last element of the array must be REMMINA_PROTOCOL_FEATURE_TYPE_END. */ +static const RemminaProtocolFeature remmina_st_features[] = +{ + { REMMINA_PROTOCOL_FEATURE_TYPE_GTKSOCKET, REMMINA_PLUGIN_ST_FEATURE_GTKSOCKET, NULL, NULL, NULL}, + { REMMINA_PROTOCOL_FEATURE_TYPE_END, 0, NULL, NULL, NULL} +}; + /* Protocol plugin definition and features */ static RemminaProtocolPlugin remmina_plugin = { @@ -258,11 +275,11 @@ static RemminaProtocolPlugin remmina_plugin = remmina_plugin_st_basic_settings, // Array for basic settings remmina_plugin_st_advanced_settings, // Array for advanced settings REMMINA_PROTOCOL_SSH_SETTING_NONE, // SSH settings type - NULL, // Array for available features + remmina_st_features, // Array for available features remmina_plugin_st_init, // Plugin initialization remmina_plugin_st_open_connection, // Plugin open connection remmina_plugin_st_close_connection, // Plugin close connection - NULL, // Query for available features + remmina_st_query_feature, // Query for available features NULL, // Call a feature NULL, // Send a keystroke NULL // Capture screenshot diff --git a/plugins/xdmcp/xdmcp_plugin.c b/plugins/xdmcp/xdmcp_plugin.c index 54bef3c6f..478047b42 100644 --- a/plugins/xdmcp/xdmcp_plugin.c +++ b/plugins/xdmcp/xdmcp_plugin.c @@ -40,6 +40,7 @@ INCLUDE_GET_AVAILABLE_XDISPLAY #define REMMINA_PLUGIN_XDMCP_FEATURE_TOOL_SENDCTRLALTDEL 1 +#define REMMINA_PLUGIN_XDMCP_FEATURE_GTKSOCKET 1 #define GET_PLUGIN_DATA(gp) (RemminaPluginXdmcpData*)g_object_get_data(G_OBJECT(gp), "plugin-data"); @@ -378,6 +379,7 @@ static const RemminaProtocolSetting remmina_plugin_xdmcp_basic_settings[] = static const RemminaProtocolFeature remmina_plugin_xdmcp_features[] = { { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PLUGIN_XDMCP_FEATURE_TOOL_SENDCTRLALTDEL, N_("Send Ctrl+Alt+Delete"), NULL, NULL }, + { REMMINA_PROTOCOL_FEATURE_TYPE_GTKSOCKET, REMMINA_PLUGIN_XDMCP_FEATURE_GTKSOCKET, NULL, NULL, NULL}, { REMMINA_PROTOCOL_FEATURE_TYPE_END, 0, NULL, NULL, NULL } }; diff --git a/src/include/remmina/types.h b/src/include/remmina/types.h index 2b194b38b..46cb93afe 100644 --- a/src/include/remmina/types.h +++ b/src/include/remmina/types.h @@ -46,7 +46,8 @@ typedef enum { REMMINA_PROTOCOL_FEATURE_TYPE_TOOL, REMMINA_PROTOCOL_FEATURE_TYPE_UNFOCUS, REMMINA_PROTOCOL_FEATURE_TYPE_SCALE, - REMMINA_PROTOCOL_FEATURE_TYPE_DYNRESUPDATE + REMMINA_PROTOCOL_FEATURE_TYPE_DYNRESUPDATE, + REMMINA_PROTOCOL_FEATURE_TYPE_GTKSOCKET } RemminaProtocolFeatureType; #define REMMINA_PROTOCOL_FEATURE_PREF_RADIO 1 diff --git a/src/remmina_connection_window.c b/src/remmina_connection_window.c index b79c4445e..1787f5080 100644 --- a/src/remmina_connection_window.c +++ b/src/remmina_connection_window.c @@ -3840,6 +3840,8 @@ GtkWidget* remmina_connection_window_open_from_file_full(RemminaFile* remminafil TRACE_CALL(__func__); RemminaConnectionObject* cnnobj; GtkWidget* protocolwidget; + gint ret; + GtkWidget* dialog; cnnobj = g_new0(RemminaConnectionObject, 1); cnnobj->remmina_file = remminafile; @@ -3904,8 +3906,23 @@ GtkWidget* remmina_connection_window_open_from_file_full(RemminaFile* remminafil if (!remmina_pref.save_view_mode) remmina_file_set_int(cnnobj->remmina_file, "viewmode", remmina_pref.default_mode); - remmina_protocol_widget_open_connection(REMMINA_PROTOCOL_WIDGET(cnnobj->proto), remminafile); - + /* If it is a GtkSocket plugin and X11 is not available, we inform the + * user and close the connection */ + ret = remmina_plugin_manager_query_feature_by_type(REMMINA_PLUGIN_TYPE_PROTOCOL, + remmina_file_get_string(remminafile, "protocol"), + REMMINA_PROTOCOL_FEATURE_TYPE_GTKSOCKET); + if (ret && remmina_gtksocket_available()) { + dialog = gtk_message_dialog_new(cnnobj->window, + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + _("Warning: This plugin require GtkSocket, but it's not available.")); + g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), NULL); + gtk_widget_show(dialog); + protocolwidget = NULL; + }else { + remmina_protocol_widget_open_connection(REMMINA_PROTOCOL_WIDGET(cnnobj->proto), remminafile); + } return protocolwidget; } diff --git a/src/remmina_plugin_manager.c b/src/remmina_plugin_manager.c index 424ea9f23..26fb2d03c 100644 --- a/src/remmina_plugin_manager.c +++ b/src/remmina_plugin_manager.c @@ -128,18 +128,6 @@ static void init_settings_cache(RemminaPlugin *plugin) static gboolean remmina_plugin_manager_register_plugin(RemminaPlugin *plugin) { TRACE_CALL(__func__); - gboolean usegtksocket = FALSE; - /* TODO: usegtksocket should be defined inside the plugin, not tested here */ - usegtksocket = (g_strcmp0 (plugin->name, "ST") == 0 || - g_strcmp0 (plugin->name, "XDMCP") == 0 || - g_strcmp0 (plugin->name, "NX") == 0 ) ? TRUE : FALSE; - if (remmina_gtksocket_available() == FALSE && usegtksocket == TRUE) { - // We don't have an X11 display, so GtkSocket will not work - remmina_public_send_notification("remmina-x11-notsupported", - _("X11 backend not available"), - _("XWayland or Xorg are required")); - return FALSE; - } if (plugin->type == REMMINA_PLUGIN_TYPE_SECRET) { if (remmina_secret_plugin) { g_print("Remmina plugin %s (type=%s) bypassed.\n", plugin->name, |