[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 01/01: history: Re-enable singleton

noreply at xfce.org noreply at xfce.org
Sun Apr 5 23:49:00 CEST 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 dbfa5f4e910070ce4134af1a55a13622231ba8ab
Author: Florian Schüller <florian.schueller at gmail.com>
Date:   Sun Apr 5 23:20:24 2020 +0200

    history: Re-enable singleton
    
    It now works even when gtk_clipboard_store() blocks for 10 seconds.
---
 panel-plugin/xfce4-clipman-history.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/panel-plugin/xfce4-clipman-history.c b/panel-plugin/xfce4-clipman-history.c
index dac8837..72413d4 100644
--- a/panel-plugin/xfce4-clipman-history.c
+++ b/panel-plugin/xfce4-clipman-history.c
@@ -539,6 +539,7 @@ main (gint argc, gchar *argv[])
   GtkApplication *app;
   int status;
   GtkClipboard *clipboard;
+  GError *error = NULL;
 
   if (!clipman_history_clipman_daemon_running ())
     {
@@ -552,6 +553,20 @@ main (gint argc, gchar *argv[])
 
   app = gtk_application_new ("org.xfce.clipman.history", G_APPLICATION_FLAGS_NONE);
 
+  g_application_register (G_APPLICATION (app), NULL, &error);
+  if (error != NULL)
+    {
+      g_warning ("Unable to register GApplication: %s", error->message);
+      g_error_free (error);
+      error = NULL;
+    }
+
+  if (g_application_get_is_remote (G_APPLICATION (app)))
+    {
+      g_warning ("%s already running", argv[0]);
+      return FALSE;
+    }
+
   g_signal_connect (app, "activate", G_CALLBACK (clipman_history_activate), NULL);
   status = g_application_run (G_APPLICATION (app), argc, argv);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list