diff --git a/configure.in b/configure.in
index 51eb258..d582404 100644
--- a/configure.in
+++ b/configure.in
@@ -27,7 +27,6 @@ m4_define([ORBit_minimum_version], [2.9.8])
 m4_define([libbonobo_minimum_version], [2.20.3])
 m4_define([gconf_minimum_version], [2.0.0])             # XXX Just a Guess
 m4_define([libglade_minimum_version], [2.0.0])          # XXX Just a Guess
-m4_define([libgnome_minimum_version], [2.0.0])          # XXX Just a Guess
 m4_define([libxml_minimum_version], [2.0.0])            # XXX Just a Guess
 m4_define([libsoup_minimum_version], [2.3.0])
 m4_define([gnome_keyring_minimum_version], [2.20.1])
@@ -239,7 +238,6 @@ PKG_CHECK_MODULES(GNOME_PLATFORM,
          libbonobo-2.0 >= libbonobo_minimum_version
          gconf-2.0 >= gconf_minimum_version
          libglade-2.0 >= libglade_minimum_version
-         libgnome-2.0 >= libgnome_minimum_version
          libxml-2.0 >= libxml_minimum_version
          libsoup-2.4 >= libsoup_minimum_version])
 
@@ -1487,11 +1485,6 @@ IDL_INCLUDES="-I"`pkg-config --variable=idldir libbonobo-2.0`" -I"`pkg-config --
 AC_MSG_RESULT($IDL_INCLUDES)
 AC_SUBST(IDL_INCLUDES)
 
-AC_MSG_CHECKING(for libgnomeui server directory)
-GNOMEUI_SERVERDIR="`$PKG_CONFIG --variable=libgnomeui_serverdir libgnomeui-2.0`"
-AC_MSG_RESULT($GNOMEUI_SERVERDIR)
-AC_DEFINE_UNQUOTED(GNOMEUI_SERVERDIR, "$GNOMEUI_SERVERDIR", [Path where we can find gnome_segv2])
-
 dnl Utility macro to set compiler flags for a specific lib.
 dnl  EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
@@ -1506,7 +1499,7 @@ dnl ****************************************
 
 dnl --- libedataserver, libedataserverui, libebackend flags
 
-E_DATA_SERVER_DEPS="libxml-2.0 libbonobo-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
+E_DATA_SERVER_DEPS="libxml-2.0 libbonobo-2.0 libsoup-2.4 gconf-2.0 gtk+-2.0 $mozilla_nspr"
 
 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
 AC_SUBST(E_DATA_SERVER_CFLAGS)
@@ -1555,7 +1548,7 @@ fi
 
 dnl --- factory flags
 
-E_FACTORY_DEPS="libgnome-2.0 $mozilla_nspr"
+E_FACTORY_DEPS="$mozilla_nspr"
 if test "x${enable_calendar}" = "xyes"; then
    E_FACTORY_DEPS="$E_FACTORY_DEPS libical"
 fi
diff --git a/servers/exchange/lib/test-utils.c b/servers/exchange/lib/test-utils.c
index 97dd100..9c9793e 100644
--- a/servers/exchange/lib/test-utils.c
+++ b/servers/exchange/lib/test-utils.c
@@ -26,7 +26,7 @@
 #include <unistd.h>
 
 #include <libedataserverui/e-passwords.h>
-#include <libgnome/gnome-util.h>
+#include <gtk/gtk.h>
 
 #include "e2k-context.h"
 #include "e2k-global-catalog.h"
@@ -246,8 +246,7 @@ idle_run (gpointer data)
 int
 main (int argc, char **argv)
 {
-	gnome_program_init (test_program_name, VERSION, LIBGNOME_MODULE,
-			    argc, argv, NULL);
+	gtk_init (&argc, &argv);
 
 	global_argc = argc;
 	global_argv = argv;
diff --git a/src/server.c b/src/server.c
index 3df0ac2..c89386f 100644
--- a/src/server.c
+++ b/src/server.c
@@ -35,7 +35,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <libgnome/gnome-init.h>
+#include <gtk/gtk.h>
 #include <bonobo-activation/bonobo-activation.h>
 #include <bonobo/bonobo-main.h>
 #include <bonobo/bonobo-exception.h>
@@ -84,56 +84,49 @@ static guint termination_handler_id;
 static GStaticMutex termination_lock = G_STATIC_MUTEX_INIT;
 
 #ifndef G_OS_WIN32
-static pthread_mutex_t segv_mutex = PTHREAD_MUTEX_INITIALIZER;
+static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT;
 static pthread_t main_thread;
+static void (*previous_segv_handler) (int);
 
 static void
-gnome_segv_handler (int signo)
+segv_redirect (int sig)
 {
-	const char *gnome_segv_path;
-	static int in_segv = 0;
-	char *exec;
-
-	if (pthread_self() != main_thread) {
-		/* deadlock intentionally in the sub-threads */
-		pthread_kill(main_thread, signo);
-		pthread_mutex_lock(&segv_mutex);
+	if (pthread_self () == main_thread)
+		previous_segv_handler (sig);
+	else {
+		pthread_kill (main_thread, sig);
+
+		/* We can't return from the signal handler or the thread may
+		   SEGV again. But we can't pthread_exit, because then the
+		   thread may get cleaned up before bug-buddy can get a stack
+		   trace. So we block by trying to lock a mutex we know is
+		   already locked.  */
+		g_static_mutex_lock (&segv_mutex);
 	}
-
-	in_segv++;
-	if (in_segv > 2) {
-                /* The fprintf() was segfaulting, we are just totally hosed */
-                _exit (1);
-        } else if (in_segv > 1) {
-                /* dialog display isn't working out */
-                fprintf (stderr, _("Multiple segmentation faults occurred; cannot display error dialog\n"));
-                _exit (1);
-        }
-
-	gnome_segv_path = GNOMEUI_SERVERDIR "/gnome_segv2";
-
-	exec = g_strdup_printf ("%s \"" PACKAGE "-" BASE_VERSION "\" %d \"" VERSION "\"",
-				gnome_segv_path, signo);
-	system (exec);
-	g_free (exec);
-
-	_exit(1);
 }
 
 static void
-setup_segv_handler (void)
+setup_segv_redirect (void)
 {
-	struct sigaction sa;
+	struct sigaction sa, osa;
+
+	sigaction (SIGSEGV, NULL, &osa);
+	if (osa.sa_handler == SIG_DFL)
+		return;
+
+	main_thread = pthread_self ();
 
 	sa.sa_flags = 0;
 	sigemptyset (&sa.sa_mask);
-	sa.sa_handler = gnome_segv_handler;
+	sa.sa_handler = segv_redirect;
 	sigaction (SIGSEGV, &sa, NULL);
 	sigaction (SIGBUS, &sa, NULL);
 	sigaction (SIGFPE, &sa, NULL);
 
-	main_thread = pthread_self();
-	pthread_mutex_lock(&segv_mutex);
+	sa.sa_handler = SIG_IGN;
+	sigaction (SIGXFSZ, &sa, NULL);
+	previous_segv_handler = osa.sa_handler;
+	g_static_mutex_lock (&segv_mutex);
 }
 
 #endif
@@ -363,17 +356,14 @@ main (int argc, char **argv)
 	signal (SIGUSR2, dump_backends);
 #endif
 
-       	gnome_program_init (PACKAGE, VERSION,
-			    LIBGNOME_MODULE,
-			    argc, argv,
-			    GNOME_PROGRAM_STANDARD_PROPERTIES, NULL);
+	gtk_init (&argc, &argv);
 
 	bonobo_init_full (&argc, argv,
 			  bonobo_activation_orb_get(),
 			  CORBA_OBJECT_NIL,
 			  CORBA_OBJECT_NIL);
 #ifndef G_OS_WIN32
-	setup_segv_handler ();
+	setup_segv_redirect ();
 #endif
 	e_data_server_module_init ();
 
