From 260fd105c01eff435b35620c96dfb719a20d292e Mon Sep 17 00:00:00 2001 From: Willie Walker Date: Thu, 1 Oct 2009 14:45:58 -0400 Subject: [PATCH] Remove all notion of a *.desktop file and session management (bfo#24106) --- configure.ac | 15 ---- registryd/Makefile.am | 18 ----- registryd/at-spi-registryd.desktop.in.in | 12 ---- registryd/registry-main.c | 106 ------------------------------ 4 files changed, 0 insertions(+), 151 deletions(-) delete mode 100644 registryd/at-spi-registryd.desktop.in.in diff --git a/configure.ac b/configure.ac index 4e9d0a7..264a061 100644 --- a/configure.ac +++ b/configure.ac @@ -119,20 +119,6 @@ if test x$enable_xevie = xyes ; then AC_SUBST(XEVIE_LIBS) fi -dnl Allow disabling SMlib -AC_ARG_ENABLE(sm, [ --enable-sm Enable session management support [default=yes]], enable_sm="$enableval", enable_sm=yes) - -if test x$enable_sm = xyes ; then - have_sm= - AC_CHECK_LIB(SM, SmcSaveYourselfDone, have_sm="yes") - if test x$have_sm = xyes ; then - SM_LIBS="-lSM -lICE" - AC_DEFINE(HAVE_SM, , [Building with SM support]) - fi - AC_SUBST(SM_LIBS) -fi - - AC_ARG_VAR([DEFAULT_ATSPI_INTROSPECTION_PATH], [Set the default path for the install ofDBus introspection XML relative to the pkgdatadir.]) @@ -175,7 +161,6 @@ AC_CONFIG_FILES([Makefile tools/Makefile droute/Makefile registryd/Makefile - registryd/at-spi-registryd.desktop.in dbind/Makefile dbind/dbind-config.h]) diff --git a/registryd/Makefile.am b/registryd/Makefile.am index 9206a3c..55852f5 100644 --- a/registryd/Makefile.am +++ b/registryd/Makefile.am @@ -32,24 +32,6 @@ at_spi_registryd_SOURCES = \ reentrant-list.h \ ucs2keysym.c -default_sessiondir = $(sysconfdir)/xdg/autostart -default_session_in_in_files = \ - at-spi-registryd.desktop.in.in -default_session_in_files = $(default_session_in_in_files:.desktop.in.in=.desktop.in) -default_session_DATA = $(default_session_in_files:.desktop.in=.desktop) - -%.desktop: %.desktop.in Makefile.am - sed -e "s,\@registryddir\@,$(libexecdir)," \ - < $< > $@ -%.desktop.in: %.desktop.in.in Makefile.am - sed -e "s,\@registryddir\@,$(libexecdir)," \ - < $< > $@ - -CLEANFILES = \ - $(default_session_DATA) \ - $(default_session_in_files) -EXTRA_DIST = at-spi-registryd.desktop.in.in - servicedir = $(DBUS_SERVICES_DIR) service_in_files = org.freedesktop.atspi.Registry.service.in service_DATA = $(service_in_files:.service.in=.service) diff --git a/registryd/at-spi-registryd.desktop.in.in b/registryd/at-spi-registryd.desktop.in.in deleted file mode 100644 index 6065e7d..0000000 --- a/registryd/at-spi-registryd.desktop.in.in +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Application -Name=AT SPI Registry Wrapper -Exec=@registryddir@/at-spi-registryd -OnlyShowIn=GNOME; -NoDisplay=true -AutostartCondition=GNOME /desktop/gnome/interface/accessibility -X-GNOME-Autostart-Phase=Initialization -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=at-spi -X-GNOME-Bugzilla-Component=general -X-GNOME-Bugzilla-Version=1.9.0 diff --git a/registryd/registry-main.c b/registryd/registry-main.c index 8429df3..a5dc5ba 100644 --- a/registryd/registry-main.c +++ b/registryd/registry-main.c @@ -36,14 +36,8 @@ #error "No introspection XML directory defined" #endif -#ifdef HAVE_SM -#include -#endif - - static gchar *dbus_name = NULL; -static void registry_session_init (const char *previous_client_id, const char *exe); static GOptionEntry optentries[] = { {"dbus-name", 0, 0, G_OPTION_ARG_STRING, &dbus_name, "Well-known name to register with D-Bus", NULL}, @@ -113,106 +107,6 @@ main (int argc, char **argv) registry = spi_registry_new (bus, droute); dec = spi_registry_dec_new (registry, bus, droute); - - /* If DESKTOP_AUTOSTART_ID exists, assume we're started by session - * manager and connect to it. */ - const char *desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); - if (desktop_autostart_id != NULL) { - char *client_id = g_strdup (desktop_autostart_id); - /* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to - * use the same client id. */ - g_unsetenv ("DESKTOP_AUTOSTART_ID"); - registry_session_init (client_id, argv[0]); - g_free (client_id); - } - - g_main_loop_run (mainloop); return 0; } - -void -registry_session_init (const char *previous_client_id, const char *exe) -{ -#ifdef HAVE_SM - char buf[256]; - char *client_id; - - SmcConn session_connection = - SmcOpenConnection (NULL, /* use SESSION_MANAGER env */ - NULL, /* means use existing ICE connection */ - SmProtoMajor, - SmProtoMinor, - 0, - NULL, - (char*) previous_client_id, - &client_id, - 255, buf); - - if (session_connection != NULL) { - SmProp prop1, prop2, prop3, prop4, prop5, prop6, *props[6]; - SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val; - char pid[32]; - char hint = SmRestartImmediately; - char priority = 1; /* low to run before other apps */ - - prop1.name = SmProgram; - prop1.type = SmARRAY8; - prop1.num_vals = 1; - prop1.vals = &prop1val; - prop1val.value = exe; - prop1val.length = strlen (exe); - - /* twm sets getuid() for this, but the SM spec plainly - * says pw_name, twm is on crack - */ - prop2.name = SmUserID; - prop2.type = SmARRAY8; - prop2.num_vals = 1; - prop2.vals = &prop2val; - prop2val.value = (char*) g_get_user_name (); - prop2val.length = strlen (prop2val.value); - - prop3.name = SmRestartStyleHint; - prop3.type = SmCARD8; - prop3.num_vals = 1; - prop3.vals = &prop3val; - prop3val.value = &hint; - prop3val.length = 1; - - sprintf (pid, "%d", getpid ()); - prop4.name = SmProcessID; - prop4.type = SmARRAY8; - prop4.num_vals = 1; - prop4.vals = &prop4val; - prop4val.value = pid; - prop4val.length = strlen (prop4val.value); - - /* Always start in home directory */ - prop5.name = SmCurrentDirectory; - prop5.type = SmARRAY8; - prop5.num_vals = 1; - prop5.vals = &prop5val; - prop5val.value = (char*) g_get_home_dir (); - prop5val.length = strlen (prop5val.value); - - prop6.name = "_GSM_Priority"; - prop6.type = SmCARD8; - prop6.num_vals = 1; - prop6.vals = &prop6val; - prop6val.value = &priority; - prop6val.length = 1; - - props[0] = &prop1; - props[1] = &prop2; - props[2] = &prop3; - props[3] = &prop4; - props[4] = &prop5; - props[5] = &prop6; - - SmcSetProperties (session_connection, 6, props); - } - -#endif -} - -- 1.5.6.5