[gthumb] fixed compilation without a session manager
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] fixed compilation without a session manager
- Date: Fri, 28 Oct 2011 16:01:26 +0000 (UTC)
commit 997d0ca8f2d86ad66aaa4e13bd5efc5ed879fcf9
Author: Paolo Bacchilega <paobac src gnome org>
Date: Thu Oct 27 20:02:12 2011 +0200
fixed compilation without a session manager
configure.ac | 3 ++-
copy-n-paste/Makefile.am | 14 +++++++++-----
gthumb/gth-main.c | 2 ++
gthumb/main.c | 24 +++++++++++++++++++-----
4 files changed, 32 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 36704fa..86129fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -527,7 +527,7 @@ GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"
AC_MSG_CHECKING([which smclient backend to use])
AC_ARG_WITH([smclient],
- [AS_HELP_STRING([--with-smclient-backend=no|xsmp|win32],
+ [AS_HELP_STRING([--with-smclient=no|xsmp|win32],
[Setting smclient backend (default:auto)])],
[],
[case "$GDK_TARGET" in
@@ -549,6 +549,7 @@ if test "$with_smclient" != "no"; then
PKG_CHECK_MODULES([SMCLIENT],[$SMCLIENT_PKGS])
AC_SUBST([SMCLIENT_CFLAGS])
AC_SUBST([SMCLIENT_LIBS])
+ AC_DEFINE(USE_SMCLIENT, 1, [Use a session menager])
fi
AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
diff --git a/copy-n-paste/Makefile.am b/copy-n-paste/Makefile.am
index 1eb10e5..0e223d9 100644
--- a/copy-n-paste/Makefile.am
+++ b/copy-n-paste/Makefile.am
@@ -1,3 +1,4 @@
+
noinst_LTLIBRARIES = libeggsmclient.la
libeggsmclient_la_LIBADD = $(SMCLIENT_LIBS) \
@@ -9,10 +10,13 @@ libeggsmclient_la_CFLAGS = -DG_LOG_DOMAIN=\""EggSMClient"\" \
$(GTK_CFLAGS)
libeggsmclient_la_SOURCES = eggdesktopfile.h \
- eggdesktopfile.c \
- eggsmclient.h \
- eggsmclient.c \
- eggsmclient-private.h \
- eggsmclient-xsmp.c
+ eggdesktopfile.c
+
+if WITH_SMCLIENT
+libeggsmclient_la_SOURCES += eggsmclient.h \
+ eggsmclient.c \
+ eggsmclient-private.h \
+ eggsmclient-xsmp.c
+endif
-include $(top_srcdir)/git.mk
diff --git a/gthumb/gth-main.c b/gthumb/gth-main.c
index 640472b..5466a75 100644
--- a/gthumb/gth-main.c
+++ b/gthumb/gth-main.c
@@ -41,7 +41,9 @@
#include <gdk/gdkx.h>
#endif
+#ifdef USE_SMCLIENT
#include "eggsmclient.h"
+#endif
#include "eggdesktopfile.h"
static GStaticMutex register_mutex = G_STATIC_MUTEX_INIT;
diff --git a/gthumb/main.c b/gthumb/main.c
index dcf7fe4..5d19d0b 100644
--- a/gthumb/main.c
+++ b/gthumb/main.c
@@ -27,7 +27,9 @@
#include <clutter/clutter.h>
#include <clutter-gtk/clutter-gtk.h>
#endif
+#ifdef USE_SMCLIENT
#include "eggsmclient.h"
+#endif
#include "gconf-utils.h"
#include "glib-utils.h"
#include "gth-browser.h"
@@ -90,6 +92,8 @@ migrate_data (void)
}
+#ifdef USE_SMCLIENT
+
static void
gth_save_state (EggSMClient *client,
GKeyFile *state,
@@ -250,6 +254,9 @@ gth_restore_session (EggSMClient *client)
}
+#endif
+
+
static void
gthumb_application_activate_cb (GApplication *application,
gpointer user_data)
@@ -318,7 +325,9 @@ gthumb_application_command_line_cb (GApplication *application,
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
+#ifdef USE_SMCLIENT
g_option_context_add_group (context, egg_sm_client_get_option_group ());
+#endif
#ifdef HAVE_CLUTTER
g_option_context_add_group (context, cogl_get_option_group ());
g_option_context_add_group (context, clutter_get_option_group_without_init ());
@@ -415,9 +424,11 @@ static void
gthumb_application_startup_cb (GApplication *application,
gpointer user_data)
{
+#ifdef USE_SMCLIENT
EggSMClient *client = NULL;
gth_session_manager_init ();
+#endif
gth_pref_initialize ();
migrate_data ();
gth_main_initialize ();
@@ -430,31 +441,34 @@ gthumb_application_startup_cb (GApplication *application,
gth_main_activate_extensions ();
gth_hook_invoke ("initialize", NULL);
+#ifdef USE_SMCLIENT
client = egg_sm_client_get ();
if (egg_sm_client_is_resumed (client))
gth_restore_session (client);
+#endif
}
static GApplication *
prepare_application (void)
{
- gthumb_application = gtk_application_new ("org.gnome.gthumb",
+ GThumb_Application = gtk_application_new ("org.gnome.gthumb",
G_APPLICATION_HANDLES_COMMAND_LINE);
- g_signal_connect (gthumb_application,
+ g_signal_connect (GThumb_Application,
"activate",
G_CALLBACK (gthumb_application_activate_cb),
NULL);
- g_signal_connect (gthumb_application,
+ g_signal_connect (GThumb_Application,
"command-line",
G_CALLBACK (gthumb_application_command_line_cb),
NULL);
- g_signal_connect (gthumb_application,
+ g_signal_connect (GThumb_Application,
"startup",
G_CALLBACK (gthumb_application_startup_cb),
NULL);
+ g_application_set_inactivity_timeout (G_APPLICATION (GThumb_Application), 10000);
- return G_APPLICATION (gthumb_application);
+ return G_APPLICATION (GThumb_Application);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]