summaryrefslogtreecommitdiff
path: root/src/terminal-window.c
diff options
context:
space:
mode:
authorspuhpointer <[email protected]>2014-09-10 10:04:27 +0200
committerStefano Karapetsas <[email protected]>2014-09-10 10:15:22 +0200
commita6a5774c681f88ebc56b86e2492697549308c52a (patch)
tree7de58233f20437b4e63477decae65eb26398bab9 /src/terminal-window.c
parent0442355666d4179ef22557149410f89ab240bdff (diff)
downloadmate-terminal-a6a5774c681f88ebc56b86e2492697549308c52a.tar.bz2
mate-terminal-a6a5774c681f88ebc56b86e2492697549308c52a.tar.xz
Added option to copy selection to clipboard
Diffstat (limited to 'src/terminal-window.c')
-rw-r--r--src/terminal-window.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 4c15774..71984ff 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -100,6 +100,9 @@ struct _TerminalWindowPrivate
/* Workaround until gtk+ bug #535557 is fixed */
guint icon_title_set : 1;
time_t focus_time;
+
+ /* should we copy selection to clibpoard */
+ int copy_selection;
};
#define PROFILE_DATA_KEY "GT::Profile"
@@ -978,6 +981,10 @@ terminal_window_update_copy_sensitivity (TerminalScreen *screen,
action = gtk_action_group_get_action (priv->action_group, "EditCopy");
gtk_action_set_sensitive (action, can_copy);
+
+ /* 24/07/2014 [email protected], sync to clibboard */
+ if (priv->copy_selection)
+ vte_terminal_copy_clipboard(VTE_TERMINAL(screen));
}
static void
@@ -2402,16 +2409,17 @@ terminal_window_show (GtkWidget *widget)
gtk_widget_get_allocation (widget, &widget_allocation);
-#if 0
TerminalWindowPrivate *priv = window->priv;
if (priv->active_screen != NULL)
{
+ terminal_window_update_copy_selection (priv->active_screen, window);
+#if 0
/* At this point, we have our GdkScreen, and hence the right
* font size, so we can go ahead and size the window. */
terminal_window_set_size (window, priv->active_screen, FALSE);
- }
#endif
+ }
terminal_window_update_geometry (window);
@@ -3099,6 +3107,16 @@ notebook_page_removed_callback (GtkWidget *notebook,
}
void
+terminal_window_update_copy_selection (TerminalScreen *screen,
+ TerminalWindow *window)
+{
+ TerminalWindowPrivate *priv = window->priv;
+ priv->copy_selection =
+ terminal_profile_get_property_boolean (terminal_screen_get_profile (screen),
+ TERMINAL_PROFILE_COPY_SELECTION);
+}
+
+void
terminal_window_update_geometry (TerminalWindow *window)
{
TerminalWindowPrivate *priv = window->priv;