ESC ESC quits
authormail <mail@joachim-breitner.de>
Mon, 22 Oct 2007 13:07:20 +0000 (13:07 +0000)
committermail <mail@joachim-breitner.de>
Mon, 22 Oct 2007 13:07:20 +0000 (13:07 +0000)
sm.c

diff --git a/sm.c b/sm.c
index 780a58a..0269ce2 100644 (file)
--- a/sm.c
+++ b/sm.c
@@ -47,7 +47,10 @@ static void realize(GtkWindow *window, GdkScreen *screen, gpointer data) {
 }
 
 static void clear_text(GtkAccelGroup *accel, GObject *window, guint keyval,  GdkModifierType modifier) {
-       gtk_text_buffer_set_text(tb,"",-1);
+       if( gtk_text_buffer_get_char_count(tb) )
+               gtk_text_buffer_set_text(tb,"",-1);
+       else
+               gtk_main_quit();
 }
 
 static char *get_text() {