--- gnome-control-center-2.22.0/typing-break/drw-break-window.c	2008-01-03 11:22:03.000000000 -0500
+++ hacked/typing-break/drw-break-window.c	2008-03-30 16:26:04.000000000 -0400
@@ -22,6 +22,7 @@
 
 #include <config.h>
 #include <string.h>
+#include <unistd.h>
 #include <math.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
@@ -57,6 +58,7 @@
 enum {
 	DONE,
 	POSTPONE,
+	LOCK,
 	LAST_SIGNAL
 };
 
@@ -96,6 +98,16 @@
 			      g_cclosure_marshal_VOID__VOID,
 			      G_TYPE_NONE, 0);
 
+	signals[LOCK] =
+		g_signal_new ("lock",
+			      G_TYPE_FROM_CLASS (klass),
+			      G_SIGNAL_RUN_LAST,
+			      0,
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	signals[DONE] =
 	signals[DONE] =
 		g_signal_new ("done",
 			      G_TYPE_FROM_CLASS (klass),
@@ -109,6 +121,13 @@
 }
 
 static void
+lock_clicked_cb (GtkWidget *button, DrwBreakWindow *window)
+{
+	g_signal_emit (window, signals[LOCK], 0, NULL);
+}
+
+
+static void
 drw_break_window_init (DrwBreakWindow *window)
 {
 	DrwBreakWindowPrivate *priv;
@@ -120,6 +139,8 @@
 	GtkWidget             *outer_vbox;
 	GtkWidget             *button_box;
 	gboolean               allow_postpone;
+	GtkWidget             *lock_button;
+	gboolean               can_lock;
 
 	gint                   root_monitor = 0;
 	GdkScreen             *screen = NULL;
@@ -142,6 +163,7 @@
 					      NULL);
 	g_object_unref (client);
 
+	can_lock = drw_can_lock_screen ();
 
 	gtk_window_set_keep_above (GTK_WINDOW (window), TRUE);
 	gtk_window_fullscreen (GTK_WINDOW (window));
@@ -179,12 +201,25 @@
 
 	gtk_box_pack_start (GTK_BOX (outer_vbox), align, TRUE, TRUE, 0);
 
-	if (allow_postpone) {
+	if (allow_postpone || can_lock) {
 		button_box = gtk_hbox_new (FALSE, 0);
 		gtk_widget_show (button_box);
 
 		gtk_container_set_border_width (GTK_CONTAINER (button_box), 12);
+		gtk_box_pack_end (GTK_BOX (outer_vbox), button_box, FALSE, TRUE, 0);
+	}
 
+	if (can_lock) {
+		lock_button = gtk_button_new_with_mnemonic (_("_Lock Screen"));
+		gtk_widget_show (lock_button);
+		gtk_box_pack_end (GTK_BOX (button_box), lock_button, FALSE, TRUE, 0);
+		g_signal_connect (lock_button,
+				  "clicked",
+				  G_CALLBACK (lock_clicked_cb),
+				  window);
+	}
+
+	if (allow_postpone) {
 		priv->postpone_button = gtk_button_new_with_mnemonic (_("_Postpone Break"));
 		gtk_widget_show (priv->postpone_button);
 
@@ -209,8 +244,6 @@
 		gtk_entry_set_has_frame (GTK_ENTRY (priv->postpone_entry), FALSE);
 
 		gtk_box_pack_end (GTK_BOX (button_box), priv->postpone_entry, FALSE, TRUE, 4);
-
-		gtk_box_pack_end (GTK_BOX (outer_vbox), button_box, FALSE, TRUE, 0);
 	}
 
 	vbox = gtk_vbox_new (FALSE, 0);
--- gnome-control-center-2.22.0/typing-break/drwright.c	2008-02-11 05:29:34.000000000 -0500
+++ hacked/typing-break/drwright.c	2008-03-30 16:27:26.000000000 -0400
@@ -103,6 +103,8 @@
 						DrWright       *dr);
 static void     break_window_postpone_cb       (GtkWidget      *window,
 						DrWright       *dr);
+static void     break_window_lock_cb           (GtkWidget      *window,
+						DrWright       *dr);
 static void     break_window_destroy_cb        (GtkWidget      *window,
 						DrWright       *dr);
 static void     popup_break_cb                 (gpointer        callback_data,
@@ -428,6 +430,11 @@
 				  dr);
 
 		g_signal_connect (dr->break_window,
+				  "lock",
+				  G_CALLBACK (break_window_lock_cb),
+				  dr);
+
+		g_signal_connect (dr->break_window,
 				  "destroy",
 				  G_CALLBACK (break_window_destroy_cb),
 				  dr);
@@ -673,6 +680,15 @@
 }
 
 static void
+break_window_lock_cb (GtkWidget *window,
+		      DrWright  *dr)
+{
+	/* ungrab the keyboard so the screensaver can start */
+	gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+	drw_lock_screen (gtk_widget_get_screen (window));	
+}
+
+static void
 break_window_destroy_cb (GtkWidget *window,
 			 DrWright  *dr)
 {
--- gnome-control-center-2.22.0/typing-break/drw-utils.c	2008-01-03 11:22:03.000000000 -0500
+++ hacked/typing-break/drw-utils.c	2008-03-30 16:27:39.000000000 -0400
@@ -19,6 +19,7 @@
  */
 
 #include <config.h>
+#include <unistd.h>
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 #include "drw-utils.h"
@@ -248,3 +249,76 @@
 	}
 }
 
+static gboolean
+drw_is_program_in_path (const char *program)
+{
+	char *tmp = g_find_program_in_path (program);
+	if (tmp != NULL) {
+		g_free (tmp);
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+static char *
+drw_get_lock_screen_command (void)
+{
+	char    *command = NULL;
+	gboolean use_gscreensaver = FALSE;
+
+	if (drw_is_program_in_path ("gnome-screensaver-command"))
+		use_gscreensaver = TRUE;
+	else if (!drw_is_program_in_path ("xscreensaver-command"))
+		return NULL;
+
+	/* Neither gnome-screensaver or xscreensaver allow root
+	 * to lock the screen */
+	if (geteuid () == 0) {
+		command = NULL;
+	} else {
+		if (use_gscreensaver) {
+			command = g_strdup_printf ("gnome-screensaver-command --lock");
+		} else {
+			command = g_strdup_printf ("xscreensaver-command -lock");
+		}
+	}
+
+	return command;
+}
+
+gboolean
+drw_can_lock_screen (void)
+{
+	char    *command;
+	gboolean enabled = FALSE;
+
+	command = drw_get_lock_screen_command ();
+	if (command)
+		enabled = TRUE;
+
+	g_free (command);
+
+	return enabled;
+}
+
+void
+drw_lock_screen (GdkScreen *screen)
+{
+	GError  *error = NULL;
+	char    *command = NULL;
+
+	g_return_if_fail (GDK_IS_SCREEN (screen));
+
+	command = drw_get_lock_screen_command ();
+
+	if (!command)
+		return;
+
+	if (!gdk_spawn_command_line_on_screen (screen, command, &error)) {
+		g_warning ("Could not execute '%s': %s", command, error->message);
+                g_error_free (error);
+        }
+
+        g_free (command);
+}
--- gnome-control-center-2.22.0/typing-break/drw-utils.h	2008-01-03 11:22:03.000000000 -0500
+++ hacked/typing-break/drw-utils.h	2008-03-30 16:21:21.000000000 -0400
@@ -23,7 +23,10 @@
 
 #include <gtk/gtkwidget.h>
 
-void drw_setup_background (GtkWidget *window);
+void     drw_setup_background (GtkWidget *window);
+
+gboolean drw_can_lock_screen (void);
+void     drw_lock_screen     (GdkScreen *screen);
 
 
 #endif /* __DRW_UTILS_H__ */
