[Xfce4-commits] <xfce4-appfinder:andrzejr/plugin> main: add --daemon option
Andrzej
noreply at xfce.org
Thu Feb 16 07:22:05 CET 2012
Updating branch refs/heads/andrzejr/plugin
to 77a2881a3fb79ecbf07728ea71c527f90a59cca8 (commit)
from 23eb637b28440ce773685d72900631cc781f61f6 (commit)
commit 77a2881a3fb79ecbf07728ea71c527f90a59cca8
Author: Andrzej <ndrwrdck at gmail.com>
Date: Wed Feb 15 21:44:08 2012 +0900
main: add --daemon option
src/main.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/main.c b/src/main.c
index d7b2e5d..bd9a379 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,6 +59,7 @@ static gboolean opt_version = FALSE;
static gboolean opt_replace = FALSE;
static gboolean opt_quit = FALSE;
static gboolean opt_disable_server = FALSE;
+static gboolean opt_daemon = FALSE;
static GSList *windows = NULL;
static gboolean service_owner = FALSE;
static XfceAppfinderModel *model_cache = NULL;
@@ -77,6 +78,7 @@ static GOptionEntry option_entries[] =
{ "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, N_("Replace the existing service"), NULL },
{ "quit", 'q', 0, G_OPTION_ARG_NONE, &opt_quit, N_("Quit all instances"), NULL },
{ "disable-server", 0, 0, G_OPTION_ARG_NONE, &opt_disable_server, N_("Do not try to use or become a D-Bus service"), NULL },
+ { "daemon", 0, 0, G_OPTION_ARG_NONE, &opt_daemon, N_("Start a D-Bus service without opening any windows."), NULL },
{ NULL }
};
@@ -557,8 +559,11 @@ main (gint argc, gchar **argv)
appfinder_refcount_debug_init ();
#endif
- /* create initial window */
- appfinder_window_new (NULL, !opt_collapsed);
+ if (G_LIKELY (!opt_daemon))
+ {
+ /* create initial window */
+ appfinder_window_new (NULL, !opt_collapsed);
+ }
APPFINDER_DEBUG ("enter mainloop");
More information about the Xfce4-commits
mailing list