im.pidgin.pidgin: 7c1e4d9a3444019b453af4bab1b27b9b3b63cb83

sadrul at pidgin.im sadrul at pidgin.im
Sat Oct 6 00:06:18 EDT 2007


revision:            7c1e4d9a3444019b453af4bab1b27b9b3b63cb83
date:                2007-10-06T04:06:30
author:              sadrul at pidgin.im
branch:              im.pidgin.pidgin
changelog:
Fix #3349 ('Status box cannot be opened with the keyboard').

manifest:
format_version "1"

new_manifest [04ad2750239d986fe87e1b018fcd41c504ca782a]

old_revision [1bdf4754abed6b49eec400ecf415a9d557bc9834]

patch "pidgin/gtkstatusbox.c"
 from [0159519a9e593047e9a0495847b9e78f56a95c28]
   to [063b9de96460ac58e129b577249c979e0327eb60]
-------------- next part --------------
============================================================
--- pidgin/gtkstatusbox.c	0159519a9e593047e9a0495847b9e78f56a95c28
+++ pidgin/gtkstatusbox.c	063b9de96460ac58e129b577249c979e0327eb60
@@ -1395,7 +1395,7 @@ pidgin_status_box_popup(PidginStatusBox 
 		return;
 	}
 	gtk_grab_add (box->popup_window);
-//	box->popup_in_progress = TRUE;
+	/*box->popup_in_progress = TRUE;*/
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button),
 				      TRUE);
 
@@ -1407,7 +1407,8 @@ static void
 }
 
 static void
-pidgin_status_box_popdown(PidginStatusBox *box) {
+pidgin_status_box_popdown(PidginStatusBox *box)
+{
 	gtk_widget_hide(box->popup_window);
 	box->popup_in_progress = FALSE;
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button),
@@ -1415,16 +1416,34 @@ pidgin_status_box_popdown(PidginStatusBo
 	gtk_grab_remove (box->popup_window);
 }
 
+static gboolean
+toggle_key_press_cb(GtkWidget *widget, GdkEventKey *event, PidginStatusBox *box)
+{
+	switch (event->keyval) {
+		case GDK_Return:
+		case GDK_KP_Enter:
+		case GDK_KP_Space:
+		case GDK_space:
+			if (!box->popup_in_progress) {
+				pidgin_status_box_popup (box);
+				box->popup_in_progress = TRUE;
+			} else {
+				pidgin_status_box_popdown(box);
+			}
+			return TRUE;
+		default:
+			return TRUE;
+	}
+}
 
-static 
-gboolean
+static gboolean
 toggled_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box)
 {
-		if (!box->popup_in_progress)
-			pidgin_status_box_popup (box);
-		else
-			pidgin_status_box_popdown(box);
-return TRUE;
+	if (!box->popup_in_progress)
+		pidgin_status_box_popup (box);
+	else
+		pidgin_status_box_popdown(box);
+	return TRUE;
 }
 
 static void
@@ -1775,6 +1794,8 @@ pidgin_status_box_init (PidginStatusBox 
 	g_signal_connect(G_OBJECT(status_box->toggle_button), "button-release-event",
 			 G_CALLBACK(button_released_cb), status_box);
 #endif
+	g_signal_connect(G_OBJECT(status_box->toggle_button), "key-press-event",
+	                 G_CALLBACK(toggle_key_press_cb), status_box);
 	g_signal_connect(G_OBJECT(status_box->toggle_button), "button-press-event",
 	                 G_CALLBACK(toggled_cb), status_box);
 	g_signal_connect(G_OBJECT(buffer), "changed", G_CALLBACK(imhtml_changed_cb), status_box);


More information about the Commits mailing list