aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-focus-tracker.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-focus-tracker.c')
-rw-r--r--widgets/misc/e-focus-tracker.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/widgets/misc/e-focus-tracker.c b/widgets/misc/e-focus-tracker.c
index d1cb32adde..8eb1b25d56 100644
--- a/widgets/misc/e-focus-tracker.c
+++ b/widgets/misc/e-focus-tracker.c
@@ -360,6 +360,10 @@ focus_tracker_dispose (GObject *object)
gtk_clipboard_get (GDK_SELECTION_PRIMARY),
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object);
+ g_signal_handlers_disconnect_matched (
+ gtk_clipboard_get (GDK_SELECTION_CLIPBOARD),
+ G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object);
+
if (priv->window != NULL) {
g_signal_handlers_disconnect_matched (
priv->window, G_SIGNAL_MATCH_DATA,
@@ -427,6 +431,16 @@ focus_tracker_constructed (GObject *object)
g_signal_connect_swapped (
clipboard, "owner-change",
G_CALLBACK (e_focus_tracker_update_actions), object);
+
+ /* Listen for "owner-change" signals from the default clipboard
+ * so we can update the paste action when the user cuts or copies
+ * something. This is how GEdit does it. */
+
+ clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+
+ g_signal_connect_swapped (
+ clipboard, "owner-change",
+ G_CALLBACK (e_focus_tracker_update_actions), object);
}
static void