diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/remmina_connection_window.c | 10 | ||||
-rw-r--r-- | src/remmina_pref.c | 6 | ||||
-rw-r--r-- | src/remmina_pref.h | 1 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 3 | ||||
-rw-r--r-- | src/remmina_pref_dialog.h | 1 |
5 files changed, 18 insertions, 3 deletions
diff --git a/src/remmina_connection_window.c b/src/remmina_connection_window.c index f0d183783..b79c4445e 100644 --- a/src/remmina_connection_window.c +++ b/src/remmina_connection_window.c @@ -1807,8 +1807,10 @@ static void remmina_connection_holder_toolbar_screenshot(GtkWidget* widget, Remm srcsurface = cairo_image_surface_create_for_data(rpsd.buffer, cairo_format, width, height, stride); // Transfer the PixBuf in the main clipboard selection - gtk_clipboard_set_image (c, gdk_pixbuf_get_from_surface ( - srcsurface, 0, 0, width, height)); + if (!remmina_pref.deny_screenshot_clipboard) { + gtk_clipboard_set_image (c, gdk_pixbuf_get_from_surface ( + srcsurface, 0, 0, width, height)); + } surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height); cr = cairo_create(surface); cairo_set_source_surface(cr, srcsurface, 0, 0); @@ -1842,7 +1844,9 @@ static void remmina_connection_holder_toolbar_screenshot(GtkWidget* widget, Remm g_print("gdk_pixbuf_get_from_window failed\n"); // Transfer the PixBuf in the main clipboard selection - gtk_clipboard_set_image (c, screenshot); + if (!remmina_pref.deny_screenshot_clipboard) { + gtk_clipboard_set_image (c, screenshot); + } // Prepare the destination cairo surface. surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height); cr = cairo_create(surface); diff --git a/src/remmina_pref.c b/src/remmina_pref.c index 35cb22e86..205b273cf 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -399,6 +399,11 @@ void remmina_pref_init(void) else remmina_pref.ssh_loglevel = DEFAULT_SSH_LOGLEVEL; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL)) + remmina_pref.deny_screenshot_clipboard = g_key_file_get_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL); + else + remmina_pref.deny_screenshot_clipboard = TRUE; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "screenshot_path", NULL)) { remmina_pref.screenshot_path = g_key_file_get_string(gkeyfile, "remmina_pref", "screenshot_path", NULL); }else{ @@ -672,6 +677,7 @@ gboolean remmina_pref_save(void) g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL); g_key_file_set_boolean(gkeyfile, "remmina_pref", "save_view_mode", remmina_pref.save_view_mode); + g_key_file_set_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", remmina_pref.deny_screenshot_clipboard); g_key_file_set_integer(gkeyfile, "remmina_pref", "floating_toolbar_placement", remmina_pref.floating_toolbar_placement); g_key_file_set_integer(gkeyfile, "remmina_pref", "toolbar_placement", remmina_pref.toolbar_placement); g_key_file_set_boolean(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", remmina_pref.prevent_snap_welcome_message); diff --git a/src/remmina_pref.h b/src/remmina_pref.h index c9cd2ebc6..66098c6fa 100644 --- a/src/remmina_pref.h +++ b/src/remmina_pref.h @@ -113,6 +113,7 @@ typedef struct _RemminaPref { gboolean save_view_mode; gint default_action; gint scale_quality; + gboolean deny_screenshot_clipboard; const gchar *screenshot_path; const gchar *screenshot_name; gint auto_scroll_step; diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 0ab353bfe..68089fa0e 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -161,6 +161,7 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data) gboolean rebuild_remmina_icon = FALSE; remmina_pref.save_view_mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_remember_last_view_mode)); + remmina_pref.deny_screenshot_clipboard = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_deny_screenshot_clipboard)); remmina_pref.fullscreen_on_auto = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto)); remmina_pref.always_show_tab = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs)); remmina_pref.hide_connection_toolbar = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar)); @@ -379,6 +380,7 @@ static void remmina_pref_dialog_init(void) gtk_dialog_set_default_response(GTK_DIALOG(remmina_pref_dialog->dialog), GTK_RESPONSE_CLOSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_remember_last_view_mode), remmina_pref.save_view_mode); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_deny_screenshot_clipboard), remmina_pref.deny_screenshot_clipboard); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto), remmina_pref.fullscreen_on_auto); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs), remmina_pref.always_show_tab); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar), remmina_pref.hide_connection_toolbar); @@ -547,6 +549,7 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent) remmina_pref_dialog->checkbutton_options_remember_last_view_mode = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_remember_last_view_mode")); remmina_pref_dialog->checkbutton_options_save_settings = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_save_settings")); + remmina_pref_dialog->checkbutton_options_deny_screenshot_clipboard = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_deny_screenshot_clipboard")); remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_fullscreen_on_auto")); remmina_pref_dialog->checkbutton_appearance_show_tabs = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_show_tabs")); remmina_pref_dialog->checkbutton_appearance_hide_toolbar = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_hide_toolbar")); diff --git a/src/remmina_pref_dialog.h b/src/remmina_pref_dialog.h index f22c35090..102508c78 100644 --- a/src/remmina_pref_dialog.h +++ b/src/remmina_pref_dialog.h @@ -49,6 +49,7 @@ typedef struct _RemminaPrefDialog { GtkNotebook *notebook_preferences; GtkCheckButton *checkbutton_options_remember_last_view_mode; + GtkCheckButton *checkbutton_options_deny_screenshot_clipboard; GtkCheckButton *checkbutton_options_save_settings; GtkCheckButton *checkbutton_appearance_fullscreen_on_auto; GtkCheckButton *checkbutton_appearance_show_tabs; |