summaryrefslogtreecommitdiff
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
parent8bd02b62d71b341911397b782dac3dbcb3802213 (diff)
downloadmate-netbook-90d41af3d0107ecd33ad5d3f01e6793454d800bb.tar.bz2
mate-netbook-90d41af3d0107ecd33ad5d3f01e6793454d800bb.tar.xz
Port from libunique to GApplication
Fixes #29
-rw-r--r--configure.ac3
-rw-r--r--maximus/main.c16
2 files changed, 12 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index a7e771d..73dc289 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,11 +51,9 @@ AC_MSG_RESULT([$with_gtk])
case "$with_gtk" in
2.0) GTK_API_VERSION=2.0
LIBWNCK_API_VERSION=1.0
- LIBUNIQUE_API_VERSION=1.0
;;
3.0) GTK_API_VERSION=3.0
LIBWNCK_API_VERSION=3.0
- LIBUNIQUE_API_VERSION=3.0
;;
esac
@@ -66,7 +64,6 @@ PKG_CHECK_MODULES(MAXIMUS_DEPS,
libwnck-$LIBWNCK_API_VERSION
xtst
libfakekey
- unique-$LIBUNIQUE_API_VERSION
)
AC_SUBST(MAXIMUS_DEPS_CFLAGS)
AC_SUBST(MAXIMUS_DEPS_LIBS)
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;
}