summaryrefslogtreecommitdiff
path: root/maximus/main.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2016-07-31 02:20:14 +0200
committermonsta <[email protected]>2016-08-20 00:26:21 +0300
commit90d41af3d0107ecd33ad5d3f01e6793454d800bb (patch)
tree506f5ab1cf7b8bc2e75a93e131334dc65bb0f072 /maximus/main.c
parent8bd02b62d71b341911397b782dac3dbcb3802213 (diff)
downloadmate-netbook-90d41af3d0107ecd33ad5d3f01e6793454d800bb.tar.bz2
mate-netbook-90d41af3d0107ecd33ad5d3f01e6793454d800bb.tar.xz
Port from libunique to GApplication
Fixes #29
Diffstat (limited to 'maximus/main.c')
-rw-r--r--maximus/main.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/maximus/main.c b/maximus/main.c
index 159c7bf..644ceca 100644
--- a/maximus/main.c
+++ b/maximus/main.c
@@ -26,7 +26,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
-#include <unique/unique.h>
+#include <gio/gio.h>
#include "maximus-app.h"
@@ -60,17 +60,25 @@ GOptionEntry entries[] =
gint main (gint argc, gchar *argv[])
{
- UniqueApp *unique;
+ GApplication *application;
MaximusApp UNUSED_VARIABLE *app;
GOptionContext *context;
+ GError *error = NULL;
g_set_application_name ("Maximus");
gtk_init (&argc, &argv);
- unique = unique_app_new ("com.canonical.Maximus", NULL);
+ application = g_application_new ("com.canonical.Maximus", G_APPLICATION_FLAGS_NONE);
+
+ if (!g_application_register (application, NULL, &error))
+ {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ return 1;
+ }
- if (unique_app_is_running (unique))
+ if (g_application_get_is_remote(application))
{
return 0;
}