Index: configure.in =================================================================== --- configure.in (revision 1245) +++ configure.in (working copy) @@ -94,7 +94,7 @@ PKG_CHECK_MODULES(MARLINX, gtk+-2.0 >= 2 AC_SUBST(MARLINX_CFLAGS) AC_SUBST(MARLINX_LIBS) -PKG_CHECK_MODULES(UNIQUE, gtkunique-1.0 >= 0.3.0) +PKG_CHECK_MODULES(UNIQUE, unique-1.0 >= 0.9.0) AC_SUBST(UNIQUE_CFLAGS) AC_SUBST(UNIQUE_LIBS) Index: src/main.c =================================================================== --- src/main.c (revision 1245) +++ src/main.c (working copy) @@ -40,7 +40,7 @@ #include <profiles/gnome-media-profiles.h> #endif -#include <gtkunique/gtkunique.h> +#include <unique/unique.h> #include <marlin/marlin-sample.h> #include <marlin/marlin-program.h> @@ -58,7 +58,7 @@ static EphyToolbarsModel *tb_model = NULL; static GList *marlin_windows = NULL; /* List of MarlinWindow */ -static GtkUniqueApp *unique_app; +static UniqueApp *unique_app; char **files = NULL; static const GOptionEntry marlin_options[] = { @@ -220,8 +220,6 @@ marlin_open_window_with_sample (MarlinSa marlin_windows = g_list_append (marlin_windows, window); - gtk_unique_app_add_window (unique_app, GTK_WINDOW (window)); - gtk_widget_show (GTK_WIDGET (window)); return GTK_WIDGET (window); @@ -314,7 +312,6 @@ marlin_open_window (const char *filename } marlin_windows = g_list_prepend (marlin_windows, window); - gtk_unique_app_add_window (unique_app, GTK_WINDOW (window)); gtk_widget_show (GTK_WIDGET (window)); @@ -422,23 +419,32 @@ process_command_line (GnomeProgram *prog } } -static GtkUniqueResponse -app_message_cb (GtkUniqueApp *app, - GtkUniqueCommand command, - const char *data, - const char *startup_id, - guint workspace) +static UniqueResponse +app_message_cb (UniqueApp *app, + gint command, + UniqueMessageData *message_data, + guint time_, + gpointer user_data) { switch (command) { - case GTK_UNIQUE_NEW: + case UNIQUE_NEW: marlin_open_window (NULL, NULL); break; - case GTK_UNIQUE_OPEN: - marlin_open_window (data, NULL); + case UNIQUE_OPEN: + { + char **uris; + int i; + + uris = unique_message_data_get_uris (message_data); + for (i = 0; uris[i]; i++) { + marlin_open_window (uris[i], NULL); + } + g_strfreev (uris); + } break; - case GTK_UNIQUE_ACTIVATE: + case UNIQUE_ACTIVATE: if (marlin_windows) { gtk_window_present (GTK_WINDOW (marlin_windows->data)); } @@ -448,7 +454,7 @@ app_message_cb (GtkUniqueApp *app, break; } - return GTK_UNIQUE_RESPONSE_OK; + return UNIQUE_RESPONSE_OK; } static void @@ -559,22 +565,37 @@ main (int argc, #endif /* IPC stuff */ - unique_app = gtk_unique_app_new ("org.gnome.Marlin"); - if (gtk_unique_app_is_running (unique_app)) { + unique_app = unique_app_new ("org.gnome.Marlin", NULL); + if (unique_app_is_running (unique_app)) { + UniqueMessageData *message = NULL; + gint command; + if (files == NULL) { - gtk_unique_app_new_document (unique_app); + command = UNIQUE_NEW; } else { int i; - - for (i = 0; files[i]; i++) { - char *path; + char **uris; + + command = UNIQUE_OPEN; + message = unique_message_data_new (); + + uris = g_new (char*, g_strv_length (files) + 1); - path = make_full_path (files[i]); - gtk_unique_app_open_uri (unique_app, path); - g_free (path); + for (i = 0; files[i]; i++) { + uris[i] = make_full_path (files[i]); } + + uris[i] = NULL; + + unique_message_data_set_uris (message, uris); } + unique_app_send_message (unique_app, command, message); + + if (message) { + unique_message_data_free (message); + } + gdk_notify_startup_complete (); g_object_unref (unique_app); @@ -606,7 +627,7 @@ main (int argc, we can free the option context */ g_option_context_free (option_ctxt); - g_signal_connect (unique_app, "message", + g_signal_connect (unique_app, "message-received", G_CALLBACK (app_message_cb), NULL); gtk_main ();