# HG changeset patch # User Sadrul Habib Chowdhury # Date 1209190774 0 # Node ID 0ccc0e9ae565fc933fc6edaf7fcfb9479efd7c9e # Parent 35621ae24544894e4a96e894130a02e2626d0825 Reset typing timeout if arrow keys are pressed when editing status message. Also replace a double-negative with a less confusing statement. diff -r 35621ae24544 -r 0ccc0e9ae565 pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Sat Apr 26 04:34:11 2008 +0000 +++ b/pidgin/gtkstatusbox.c Sat Apr 26 06:19:34 2008 +0000 @@ -1140,7 +1140,7 @@ GTK_DIR_TAB_BACKWARD: GTK_DIR_TAB_FORWARD); return TRUE; } - if (!status_box->typing != 0) + if (status_box->typing == 0) return FALSE; /* Reset the status if Escape was pressed */ @@ -1695,6 +1695,17 @@ } static void +imhtml_cursor_moved_cb(gpointer data, GtkMovementStep step, gint count, gboolean extend, + GtkWidget *widget) +{ + /* Restart the typing timeout if arrow keys are pressed while editing the message */ + PidginStatusBox *status_box = data; + if (status_box->typing == 0) + return; + imhtml_changed_cb(NULL, status_box); +} + +static void pidgin_status_box_init (PidginStatusBox *status_box) { GtkCellRenderer *text_rend; @@ -1836,6 +1847,8 @@ g_signal_connect(G_OBJECT(buffer), "changed", G_CALLBACK(imhtml_changed_cb), status_box); g_signal_connect(G_OBJECT(status_box->imhtml), "format_function_toggle", G_CALLBACK(imhtml_format_changed_cb), status_box); + g_signal_connect_swapped(G_OBJECT(status_box->imhtml), "move_cursor", + G_CALLBACK(imhtml_cursor_moved_cb), status_box); g_signal_connect(G_OBJECT(status_box->imhtml), "key_press_event", G_CALLBACK(imhtml_remove_focus), status_box); g_signal_connect_swapped(G_OBJECT(status_box->imhtml), "message_send", G_CALLBACK(remove_typing_cb), status_box);