Reset timeout on cursor movement
authorJoachim Breitner <mail@joachim-breitner.de>
Mon, 25 Aug 2008 10:33:58 +0000 (10:33 +0000)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 25 Aug 2008 10:33:58 +0000 (10:33 +0000)
Thanks to Paul Wise <pabs@debian.org>, Closes: 496467

sm.c

diff --git a/sm.c b/sm.c
index bf0e625..ce578f5 100644 (file)
--- a/sm.c
+++ b/sm.c
@@ -168,6 +168,14 @@ static void newtext() {
        hq(FALSE, TRUE);
 }
 
+static void mark_deleted(GtkTextBuffer* tb, GtkTextMark* m, gpointer d){
+       show_entry();
+}
+
+static void mark_set(GtkTextBuffer* tb, GtkTextIter* l, GtkTextMark* m, gpointer d){
+       show_entry();
+}
+
 static struct option const long_options[] =
 {
        {"help",       no_argument,       NULL, 'h'},
@@ -350,6 +358,8 @@ int main(int argc, char **argv) {
 
        g_signal_connect_after(G_OBJECT(draw), "expose-event", G_CALLBACK(redraw), NULL);
        g_signal_connect(G_OBJECT(tb), "changed", G_CALLBACK(newtext), NULL);
+       g_signal_connect(G_OBJECT(tb), "mark-set", G_CALLBACK(mark_set), NULL);
+       g_signal_connect(G_OBJECT(tb), "mark-deleted", G_CALLBACK(mark_deleted), NULL);
 
        if (!input_provided)
                show_entry();