[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 10/37: Make sure to save the clipboard when quitting
noreply at xfce.org
noreply at xfce.org
Mon Mar 23 23:30:05 CET 2020
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-clipman-plugin.
commit febf2e1514bc667967b3ac97aeae017df5e6a028
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Mon Mar 16 21:33:17 2020 +0100
Make sure to save the clipboard when quitting
---
panel-plugin/xfce4-clipman-history.c | 39 ++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/panel-plugin/xfce4-clipman-history.c b/panel-plugin/xfce4-clipman-history.c
index e1a7bed..3cd81ee 100644
--- a/panel-plugin/xfce4-clipman-history.c
+++ b/panel-plugin/xfce4-clipman-history.c
@@ -243,15 +243,6 @@ clipman_history_treeview_init (MyPlugin *plugin)
return box;
}
-static void
-clipman_history_dialog_response (GtkWidget *dialog,
- gint response_id,
- gpointer user_data)
-{
- if (response_id = GTK_RESPONSE_CLOSE)
- gtk_main_quit ();
-}
-
GtkWidget *
clipman_history_dialog_init (MyPlugin *plugin)
{
@@ -285,6 +276,32 @@ clipman_history_dialog_init (MyPlugin *plugin)
return dialog;
}
+static void
+clipman_history_dialog_finalize (MyPlugin *plugin)
+{
+ plugin_save (plugin);
+ gtk_main_quit ();
+}
+
+static void
+clipman_history_dialog_response (GtkWidget *dialog,
+ gint response_id,
+ MyPlugin *plugin)
+{
+ if (response_id = GTK_RESPONSE_CLOSE)
+ clipman_history_dialog_finalize (plugin);
+}
+
+gboolean
+clipman_history_dialog_delete_event (GtkWidget *widget,
+ GdkEvent *event,
+ MyPlugin *plugin)
+{
+ clipman_history_dialog_finalize (plugin);
+
+ return TRUE;
+}
+
gint
main (gint argc, gchar *argv[])
{
@@ -330,8 +347,8 @@ main (gint argc, gchar *argv[])
plugin_load (plugin);
dialog = clipman_history_dialog_init (plugin);
- g_signal_connect (G_OBJECT (dialog), "delete-event", G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (clipman_history_dialog_response), NULL);
+ g_signal_connect (G_OBJECT (dialog), "delete-event", G_CALLBACK (clipman_history_dialog_delete_event), plugin);
+ g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (clipman_history_dialog_response), plugin);
gtk_window_present (GTK_WINDOW (dialog));
gtk_main ();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list