changeset 24895:b15168f2b7ee

merge of '479fd75025803f01e743b5c39e6706b1d42a3520' and 'f5f0cca8a5f385b7c637236b48aceef1aaa97899'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 06 Jan 2009 22:41:16 +0000
parents 61f3a9f7a220 (current diff) cead8692e35f (diff)
children 380e7149a777
files libpurple/protocols/myspace/myspace.c
diffstat 6 files changed, 31 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntmain.c	Tue Jan 06 05:03:18 2009 +0000
+++ b/finch/libgnt/gntmain.c	Tue Jan 06 22:41:16 2009 +0000
@@ -21,7 +21,7 @@
  */
 
 #define _GNU_SOURCE
-#if (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__)
+#if (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
 #define _XOPEN_SOURCE_EXTENDED
 #endif
 
--- a/finch/libgnt/gnttree.c	Tue Jan 06 05:03:18 2009 +0000
+++ b/finch/libgnt/gnttree.c	Tue Jan 06 22:41:16 2009 +0000
@@ -518,6 +518,7 @@
 
 		if (row == tree->current)
 		{
+			attr |= A_BOLD;
 			if (gnt_widget_has_focus(widget))
 				attr |= gnt_color_pair(GNT_COLOR_HIGHLIGHT);
 			else
--- a/finch/libgnt/gntwindow.c	Tue Jan 06 05:03:18 2009 +0000
+++ b/finch/libgnt/gntwindow.c	Tue Jan 06 22:41:16 2009 +0000
@@ -49,7 +49,16 @@
 {
 	GntWindow *win = GNT_WINDOW(bind);
 	if (win->menu) {
-		gnt_screen_menu_show(win->menu);
+		GntMenu *menu = win->menu;
+
+		gnt_screen_menu_show(menu);
+		if (menu->type == GNT_MENU_TOPLEVEL) {
+			GntMenuItem *item;
+			item = g_list_nth_data(menu->list, menu->selected);
+			if (item && gnt_menuitem_get_submenu(item)) {
+				gnt_widget_activate(GNT_WIDGET(menu));
+			}
+		}
 		return TRUE;
 	}
 	return FALSE;
--- a/finch/libgnt/gntwm.c	Tue Jan 06 05:03:18 2009 +0000
+++ b/finch/libgnt/gntwm.c	Tue Jan 06 22:41:16 2009 +0000
@@ -26,7 +26,7 @@
 #include <Python.h>
 #else
 #define _GNU_SOURCE
-#if (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__)
+#if (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
 #define _XOPEN_SOURCE_EXTENDED
 #endif
 #endif
--- a/finch/libgnt/wms/irssi.c	Tue Jan 06 05:03:18 2009 +0000
+++ b/finch/libgnt/wms/irssi.c	Tue Jan 06 22:41:16 2009 +0000
@@ -71,7 +71,12 @@
 	width = (getmaxx(stdscr) - irssi->buddylistwidth) / irssi->horiz;
 	height = (getmaxy(stdscr) - 1) / irssi->vert;
 
-	rx = irssi->buddylistwidth;
+	if (width) {
+		rx = irssi->buddylistwidth;
+	} else {
+		rx = 0;
+		width = getmaxx(stdscr) / irssi->horiz;
+	}
 	if (hor)
 		rx += hor * width;
 	if (rx)
@@ -234,7 +239,7 @@
 	height = (getmaxy(stdscr) - 1) / irssi->vert;
 
 	if (h)
-		*h = (x - irssi->buddylistwidth) / width;
+		*h = width ? (x - irssi->buddylistwidth) / width : x / (getmaxx(stdscr) / irssi->horiz);
 	if (v)
 		*v = y / height;
 }
@@ -278,6 +283,7 @@
 {
 	int vert, hor;
 	int x, y, w, h;
+	const char *name;
 
 	if (!GNT_IS_WINDOW(widget))
 		return;
@@ -286,10 +292,13 @@
 		return;
 	}
 
-	find_window_position(irssi, widget, &hor, &vert);
-	get_xywh_for_frame(irssi, hor, vert, &x, &y, &w, &h);
-	gnt_wm_move_window(GNT_WM(irssi), widget, x, y);
-	gnt_wm_resize_window(GNT_WM(irssi), widget, w, h);
+	name = gnt_widget_get_name(widget);
+	if (name && strstr(name, "conversation-window")) {
+		find_window_position(irssi, widget, &hor, &vert);
+		get_xywh_for_frame(irssi, hor, vert, &x, &y, &w, &h);
+		gnt_wm_move_window(GNT_WM(irssi), widget, x, y);
+		gnt_wm_resize_window(GNT_WM(irssi), widget, w, h);
+	}
 }
 
 static void
--- a/libpurple/protocols/myspace/myspace.c	Tue Jan 06 05:03:18 2009 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Tue Jan 06 22:41:16 2009 +0000
@@ -2883,10 +2883,9 @@
 	}
 
 	/* Strip spaces. */
-	for (i=0, j=0; normalized[j]; i++, j++) {
-		while (normalized[j] == ' ')
-			j++;
-		normalized[i] = normalized[j];
+	for (i=0, j=0; normalized[j]; j++) {
+		if (normalized[j] != ' ')
+			normalized[i++] = normalized[j];
 	}
 	normalized[i] = '\0';