Commit 0596fa2d authored by Ray Strode's avatar Ray Strode

Make screenshot dir a configure argument

This provides a little more flexibility to distributors,
but more importantly makes it less hard coded in gdm-screenshot.c
parent 650175fc
......@@ -1236,6 +1236,23 @@ fi
AC_SUBST(GDM_XAUTH_DIR)
dnl ---------------------------------------------------------------------------
dnl - Directory for greeter screenshot
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(screenshot-dir,
AS_HELP_STRING([--with-screenshot-dir=<dir>],
[directory to store greeter screenshot]))
if ! test -z "$with_screenshot_dir"; then
GDM_SCREENSHOT_DIR=$with_screenshot_dir
else
GDM_SCREENSHOT_DIR=${localstatedir}/run/gdm
fi
AC_SUBST(GDM_SCREENSHOT_DIR)
dnl ---------------------------------------------------------------------------
dnl - Finish
dnl ---------------------------------------------------------------------------
......
......@@ -13,6 +13,7 @@ predir = $(gdmconfdir)/PreSession
postlogindir = $(gdmconfdir)/PostLogin
workingdir = $(GDM_WORKING_DIR)
xauthdir = $(GDM_XAUTH_DIR)
screenshotdir = $(GDM_SCREENSHOT_DIR)
cachedir = $(localstatedir)/cache/gdm
Xsession: $(srcdir)/Xsession.in
......@@ -123,6 +124,7 @@ uninstall-hook:
-rf \
$(DESTDIR)$(workingdir)/.gconf.mandatory \
$(DESTDIR)$(xauthdir)
$(DESTDIR)$(screenshotdir)
install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession gconf.path
if test '!' -d $(DESTDIR)$(gdmconfdir); then \
......@@ -204,6 +206,12 @@ install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession gconf.pa
chown root:gdm $(DESTDIR)$(xauthdir) || : ; \
fi
if test '!' -d $(DESTDIR)$(screenshotdir); then \
$(mkinstalldirs) $(DESTDIR)$(screenshotdir); \
chmod 0755 $(DESTDIR)$(screenshotdir); \
chown gdm:gdm $(DESTDIR)$(screenshotdir) || : ; \
fi
if test '!' -d $(DESTDIR)$(workingdir); then \
$(mkinstalldirs) $(DESTDIR)$(workingdir); \
chmod 1770 $(DESTDIR)$(workingdir); \
......
......@@ -4,6 +4,7 @@ AM_CPPFLAGS = \
-I. \
-I.. \
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
-DGDM_SCREENSHOT_DIR=\""$(GDM_SCREENSHOT_DIR)"\"\
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
$(UTILS_CFLAGS) \
$(CANBERRA_GTK_CFLAGS) \
......
......@@ -163,11 +163,8 @@ screenshot_save (GdkPixbuf *pixbuf)
char *filename;
gboolean res;
GError *error;
const char *save_dir;
save_dir = LOCALSTATEDIR "/run/gdm";
filename = g_build_filename (save_dir,
filename = g_build_filename (GDM_SCREENSHOT_DIR,
"GDM-Screenshot.png",
NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment