im.pidgin.pidgin.next.minor: 0d423b83c4fa37d15724d416d2fcccc710281ad5

sadrul at pidgin.im sadrul at pidgin.im
Wed Oct 24 06:10:39 EDT 2007


-----------------------------------------------------------------
Revision: 0d423b83c4fa37d15724d416d2fcccc710281ad5
Ancestor: f665112e9c4d40102f5791db204233c26ddf8e6c
Author: sadrul at pidgin.im
Date: 2007-10-21T08:40:42
Branch: im.pidgin.pidgin.next.minor

Modified files:
        finch/libgnt/gntmenu.c

ChangeLog: 

Fix menu hiding.

-------------- next part --------------
============================================================
--- finch/libgnt/gntmenu.c	d74770a6a8fed6a1999c6842417980d24e568cde
+++ finch/libgnt/gntmenu.c	2c3d027112edcc789a73af4c2114d0526d95aa6b
@@ -48,6 +48,14 @@ static void
 static gboolean (*org_key_pressed)(GntWidget *w, const char *t);
 
 static void
+menu_hide_all(GntMenu *menu)
+{
+	while (menu->parentmenu)
+		menu = menu->parentmenu;
+	gnt_widget_hide(GNT_WIDGET(menu));
+}
+
+static void
 gnt_menu_draw(GntWidget *widget)
 {
 	GntMenu *menu = GNT_MENU(widget);
@@ -185,10 +193,7 @@ menuitem_activate(GntMenu *menu, GntMenu
 		return;
 
 	if (gnt_menuitem_activate(item)) {
-		while (menu) {
-			gnt_widget_hide(GNT_WIDGET(menu));
-			menu = menu->parentmenu;
-		}
+		menu_hide_all(menu);
 	} else {
 		if (item->submenu) {
 			GntMenu *sub = GNT_MENU(item->submenu);
@@ -203,6 +208,8 @@ menuitem_activate(GntMenu *menu, GntMenu
 			gnt_widget_set_position(GNT_WIDGET(sub), item->priv.x, item->priv.y);
 			GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(sub), GNT_WIDGET_INVISIBLE);
 			gnt_widget_draw(GNT_WIDGET(sub));
+		} else {
+			menu_hide_all(menu);
 		}
 	}
 }
@@ -288,10 +295,8 @@ gnt_menu_key_pressed(GntWidget *widget, 
 
 		if (current != menu->selected) {
 			GntMenu *sub = menu->submenu;
-			while (sub) {
+			if (sub)
 				gnt_widget_hide(GNT_WIDGET(sub));
-				sub = sub->submenu;
-			}
 			gnt_widget_draw(widget);
 			return TRUE;
 		}


More information about the Commits mailing list