pidgin: 3578e7f4: Reset typing timeout if arrow keys are p...

sadrul at pidgin.im sadrul at pidgin.im
Sat Apr 26 02:25:38 EDT 2008


-----------------------------------------------------------------
Revision: 3578e7f4bb0e7d1716dab8b0d111eba4b2130536
Ancestor: 880e9573b41f7804845be8a517899f54013a074c
Author: sadrul at pidgin.im
Date: 2008-04-26T06:19:34
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3578e7f4bb0e7d1716dab8b0d111eba4b2130536

Modified files:
        pidgin/gtkstatusbox.c

ChangeLog: 

Reset typing timeout if arrow keys are pressed when editing status
message. Also replace a double-negative with a less confusing statement.

-------------- next part --------------
============================================================
--- pidgin/gtkstatusbox.c	c6b7f9f574a3f6b172312d8a303068a2e4266cd7
+++ pidgin/gtkstatusbox.c	08182f8933b8864f84e299c4039da568111a8ef0
@@ -1140,7 +1140,7 @@ static gboolean imhtml_remove_focus(GtkW
 				                  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
 }
 
 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 @@ pidgin_status_box_init (PidginStatusBox 
 	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);


More information about the Commits mailing list