Index: src/callbacks.c
===================================================================
RCS file: /cvs/gnome/gnome-system-monitor/src/callbacks.c,v
retrieving revision 1.131
diff -u -p -r1.131 callbacks.c
--- src/callbacks.c	4 Sep 2005 02:49:43 -0000	1.131
+++ src/callbacks.c	19 Apr 2006 16:03:35 -0000
@@ -24,6 +24,8 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <signal.h>
+#include <X11/Xlib.h>
+#include <gdk/gdkx.h>
 #include "callbacks.h"
 #include "interface.h"
 #include "proctable.h"
@@ -222,6 +224,32 @@ void
 cb_end_process_button_pressed (GtkButton *button, gpointer data)
 {
 	kill_process_helper(data, SIGTERM);
+}
+
+void
+cb_log_out_button_pressed (GtkButton *button, gpointer data)
+{
+        char *atom_names[] = { "_GNOME_PANEL_ACTION", "_GNOME_PANEL_ACTION_LOG_OUT" };
+        Atom atoms[G_N_ELEMENTS (atom_names)];
+        Display *xdisplay;
+        XClientMessageEvent ev;
+        Window xroot;
+
+        xdisplay = GDK_WINDOW_XDISPLAY (button->event_window);
+        xroot = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (gdk_drawable_get_screen (button->event_window)));
+        
+        XInternAtoms (xdisplay, atom_names, G_N_ELEMENTS (atom_names), False, atoms);
+
+        ev.type = ClientMessage;
+        ev.window = xroot;
+        ev.message_type = atoms[0];
+        ev.format = 32;
+        ev.data.l[0] = atoms[1];
+        ev.data.l[1] = gdk_x11_get_server_time (button->event_window);
+
+        gdk_error_trap_push ();
+        XSendEvent (xdisplay, xroot, False, StructureNotifyMask, (XEvent*) &ev);
+        gdk_error_trap_pop ();
 }
 
 
Index: src/callbacks.h
===================================================================
RCS file: /cvs/gnome/gnome-system-monitor/src/callbacks.h,v
retrieving revision 1.47
diff -u -p -r1.47 callbacks.h
--- src/callbacks.h	13 Jul 2005 14:35:04 -0000	1.47
+++ src/callbacks.h	19 Apr 2006 16:03:35 -0000
@@ -41,6 +41,7 @@ void		cb_app_exit (GtkAction *action, gp
 gboolean	cb_app_delete (GtkWidget *window, GdkEventAny *event, gpointer data) G_GNUC_INTERNAL;
 
 void		cb_end_process_button_pressed (GtkButton *button, gpointer data) G_GNUC_INTERNAL;
+void            cb_log_out_button_pressed (GtkButton *button, gpointer data) G_GNUC_INTERNAL;
 void		cb_logout (GtkButton *button, gpointer data) G_GNUC_INTERNAL;
 
 void		cb_info_button_pressed (GtkButton *button, gpointer user_data) G_GNUC_INTERNAL;
Index: src/interface.c
===================================================================
RCS file: /cvs/gnome/gnome-system-monitor/src/interface.c,v
retrieving revision 1.152
diff -u -p -r1.152 interface.c
--- src/interface.c	10 Jan 2006 21:56:27 -0000	1.152
+++ src/interface.c	19 Apr 2006 16:03:35 -0000
@@ -170,6 +170,14 @@ create_proc_view (ProcData *procdata)
 	g_free (string);
 	gtk_box_pack_start (GTK_BOX (hbox1), procdata->loadavg, FALSE, FALSE, 0);
 
+        procdata->logoutbutton = gtk_button_new_with_mnemonic (_("_Log Out"));
+
+        gtk_button_set_image (GTK_BUTTON (procdata->logoutbutton),
+          gtk_image_new_from_icon_name ("gnome-logout", GTK_ICON_SIZE_BUTTON));
+        gtk_box_pack_end (GTK_BOX (hbox1), procdata->logoutbutton, FALSE, FALSE, 0);
+        g_signal_connect (G_OBJECT (procdata->logoutbutton), "clicked",
+            G_CALLBACK (cb_log_out_button_pressed), procdata);
+
 	gtk_widget_show_all (hbox1);
 
 	scrolled = proctable_new (procdata);
Index: src/procman.h
===================================================================
RCS file: /cvs/gnome/gnome-system-monitor/src/procman.h,v
retrieving revision 1.90
diff -u -p -r1.90 procman.h
--- src/procman.h	9 Apr 2006 11:41:42 -0000	1.90
+++ src/procman.h	19 Apr 2006 16:03:35 -0000
@@ -118,6 +118,7 @@ struct _ProcData
 	GtkWidget	*tree;
 	GtkWidget	*loadavg;
 	GtkWidget	*endprocessbutton;
+	GtkWidget	*logoutbutton;
 	GtkWidget	*popup_menu;
 	GtkWidget	*disk_list;
 	ProcConfig	config;
