im.pidgin.pidgin.2.3.1: 62e051e24242ea1c6c32febfd62c034dea8398a0

sadrul at pidgin.im sadrul at pidgin.im
Sat Dec 1 17:20:55 EST 2007


-----------------------------------------------------------------
Revision: 62e051e24242ea1c6c32febfd62c034dea8398a0
Ancestor: d369e26b3b5dfcaa73ba7c0897fb8507ff325a28
Author: sadrul at pidgin.im
Date: 2007-12-01T22:17:32
Branch: im.pidgin.pidgin.2.3.1

Modified files:
        finch/libgnt/gnt.h finch/libgnt/gntbox.c
        finch/libgnt/gntentry.c finch/libgnt/gntmenu.c
        finch/libgnt/gntwindow.c finch/libgnt/test/tv.c

ChangeLog: 

Pluck some bug-fixes for finch/gnt for the bug-fix release.

applied changes from 478aa9dbaf498fead2266060ae758f48fa57f3d7
             through 66d234740bd40b14ef7564f178d84ab82816d6e2

applied changes from 2cbd8db1d77e345ea55b3b765ca79726273ca727
             through fb4562e25805935b7f84c12cc47a028a0dc25f3a

applied changes from fb4562e25805935b7f84c12cc47a028a0dc25f3a
             through e8f945cbbdd235c0fb371834fddf396f568b672f

applied changes from 96bb0250f516ff49a03fcaa2b7720865d9668ccd
             through 10b5584bcb92c67e0dc20d17fd72eeaf351aaa86

applied changes from 10b5584bcb92c67e0dc20d17fd72eeaf351aaa86
             through 0fbf448aa3c17cb83eac458e6f9b06e38fd14d1d

-------------- next part --------------
============================================================
--- finch/libgnt/gnt.h	24a6d5a3984ee34d6e09223fac18b7cc84b01277
+++ finch/libgnt/gnt.h	e673e6778263df354f74bd33ce4d2400ed7eac3a
@@ -30,6 +30,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#ifndef GNT_H
+#define GNT_H
+
 #include <glib.h>
 #include "gntwidget.h"
 #include "gntclipboard.h"
@@ -201,3 +204,4 @@ gboolean gnt_is_refugee(void);
  */
 gboolean gnt_is_refugee(void);
 
+#endif /* GNT_H */
============================================================
--- finch/libgnt/gntbox.c	b301f26a8664fc4b494cd4a0f5ff3ead9ff4b269
+++ finch/libgnt/gntbox.c	ec1857f6d84f79f15c18b9784f5b610b7923ca98
@@ -851,8 +851,14 @@ void gnt_box_give_focus_to_child(GntBox 
 
 void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget)
 {
-	GList *find = g_list_find(box->focus, widget);
-	gpointer now = box->active;
+	GList *find;
+	gpointer now;
+
+	while (GNT_WIDGET(box)->parent)
+		box = GNT_BOX(GNT_WIDGET(box)->parent);
+
+	find = g_list_find(box->focus, widget);
+	now = box->active;
 	if (find)
 		box->active = widget;
 	if (now && now != box->active)
============================================================
--- finch/libgnt/gntentry.c	d8698f95f37f000571dd6eb3d60105275658914e
+++ finch/libgnt/gntentry.c	1226b105ba750769e98f0c2828d3590fb799cf19
@@ -575,15 +575,16 @@ next_begin_word(const char *text, const 
 next_begin_word(const char *text, const char *end)
 {
 	gunichar ch = 0;
+
+	while (text && text < end && g_unichar_isspace(g_utf8_get_char(text)))
+		text = g_utf8_find_next_char(text, end);
+
 	ch = g_utf8_get_char(text);
 	while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
 		gunichar cur = g_utf8_get_char(text);
 		if (!SAME(ch, cur))
 			break;
 	}
-
-	while (text && text < end && g_unichar_isspace(g_utf8_get_char(text)))
-		text = g_utf8_find_next_char(text, end);
 	return (text ? text : end);
 }
 
============================================================
--- finch/libgnt/gntmenu.c	f5ecf5004906b3743567f5376f50aa37d622f3e6
+++ finch/libgnt/gntmenu.c	847190bb8f0f653dd972e35e28f1284135861834
@@ -47,6 +47,8 @@ static gboolean (*org_key_pressed)(GntWi
 static void (*org_size_request)(GntWidget *wid);
 static gboolean (*org_key_pressed)(GntWidget *w, const char *t);
 
+static void menuitem_activate(GntMenu *menu, GntMenuItem *item);
+
 static void
 menu_hide_all(GntMenu *menu)
 {
@@ -56,6 +58,20 @@ static void
 }
 
 static void
+show_submenu(GntMenu *menu)
+{
+	GntMenuItem *item;
+
+	if (menu->type != GNT_MENU_TOPLEVEL)
+			return;
+
+	item = g_list_nth_data(menu->list, menu->selected);
+	if (!item || !item->submenu)
+		return;
+	menuitem_activate(menu, item);
+}
+
+static void
 gnt_menu_draw(GntWidget *widget)
 {
 	GntMenu *menu = GNT_MENU(widget);
@@ -276,6 +292,8 @@ gnt_menu_key_pressed(GntWidget *widget, 
 			gnt_widget_hide(widget);
 		} else
 			gnt_widget_hide(widget);
+		if (par && par->type == GNT_MENU_TOPLEVEL)
+			gnt_menu_key_pressed(GNT_WIDGET(par), text);
 		return TRUE;
 	}
 
@@ -297,6 +315,7 @@ gnt_menu_key_pressed(GntWidget *widget, 
 			GntMenu *sub = menu->submenu;
 			if (sub)
 				gnt_widget_hide(GNT_WIDGET(sub));
+			show_submenu(menu);
 			gnt_widget_draw(widget);
 			return TRUE;
 		}
============================================================
--- finch/libgnt/gntwindow.c	43237d98f8e7ab9a1ef12ec2b85e87da4205dadc
+++ finch/libgnt/gntwindow.c	f653edd2e24f5f8a5d67bf830dd209d67eec8baa
@@ -62,7 +62,8 @@ gnt_window_destroy(GntWidget *widget)
 	if (window->menu)
 		gnt_widget_destroy(GNT_WIDGET(window->menu));
 	if (window->priv) {
-		g_hash_table_destroy(window->priv->accels);
+		if (window->priv->accels)
+			g_hash_table_destroy(window->priv->accels);
 		g_free(window->priv);
 	}
 	org_destroy(widget);
============================================================
--- finch/libgnt/test/tv.c	a9326fa1cb38640fd6f0c3ec5cf7ca31d87bf9d0
+++ finch/libgnt/test/tv.c	1038f94c8f4b988ee5e799f8d27ee07798516572
@@ -112,8 +112,8 @@ int main()
 	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD);
 	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 2nd line\n", GNT_TEXT_FLAG_NORMAL);
 
-	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD);
-	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 3rd line\n", GNT_TEXT_FLAG_NORMAL);
+	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD | gnt_color_pair(GNT_COLOR_HIGHLIGHT));
+	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 3rd line\n", GNT_TEXT_FLAG_NORMAL | gnt_color_pair(GNT_COLOR_HIGHLIGHT));
 
 	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD);
 	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 4th line\n", GNT_TEXT_FLAG_NORMAL);


More information about the Commits mailing list