changeset 17062:ce02eb521787

merge of '2ac6f565005a69737bcf28a5f6ca11d74d2e5733' and '8e37281eaf4dac95a5312eb2524d34f51e8c77d3'
author Richard Laager <rlaager@wiktel.com>
date Sat, 12 May 2007 02:43:16 +0000
parents bc16e00f1f7d (current diff) 4ce5f452e0df (diff)
children fdd1a73aa37e
files
diffstat 4 files changed, 82 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/finch/finch.c	Sat May 12 02:40:59 2007 +0000
+++ b/finch/finch.c	Sat May 12 02:43:16 2007 +0000
@@ -214,11 +214,6 @@
 		{0, 0, 0, 0}
 	};
 
-#ifdef PURPLE_FATAL_ASSERTS
-	/* Make g_return_... functions fatal. */
-	g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
-#endif
-
 #ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset(PACKAGE, "UTF-8");
--- a/finch/libgnt/gntmain.c	Sat May 12 02:40:59 2007 +0000
+++ b/finch/libgnt/gntmain.c	Sat May 12 02:43:16 2007 +0000
@@ -144,7 +144,10 @@
 		event = GNT_MOUSE_UP;
 	} else
 		return FALSE;
-	
+
+	if (!widget)
+		return FALSE;
+
 	if (gnt_wm_process_click(wm, event, x, y, widget))
 		return TRUE;
 	
@@ -348,6 +351,10 @@
 	gnt_wm_raise_window(wm, win);
 }
 
+#ifdef SIGWINCH
+static void (*org_winch_handler)(int);
+#endif
+
 static void
 sighandler(int sig)
 {
@@ -357,6 +364,7 @@
 		werase(stdscr);
 		wrefresh(stdscr);
 		g_idle_add(refresh_screen, NULL);
+		org_winch_handler(sig);
 		signal(SIGWINCH, sighandler);
 		break;
 #endif
@@ -434,7 +442,7 @@
 	wrefresh(stdscr);
 
 #ifdef SIGWINCH
-	signal(SIGWINCH, sighandler);
+	org_winch_handler = signal(SIGWINCH, sighandler);
 #endif
 	signal(SIGCHLD, sighandler);
 	signal(SIGINT, sighandler);
--- a/finch/libgnt/gntwm.c	Sat May 12 02:40:59 2007 +0000
+++ b/finch/libgnt/gntwm.c	Sat May 12 02:43:16 2007 +0000
@@ -48,6 +48,10 @@
 static void update_window_in_list(GntWM *wm, GntWidget *wid);
 static void shift_window(GntWM *wm, GntWidget *widget, int dir);
 
+#ifndef NO_WIDECHAR
+static int widestringwidth(wchar_t *wide);
+#endif
+
 static gboolean write_already(gpointer data);
 static int write_timeout;
 static time_t last_active_time;
@@ -136,6 +140,65 @@
 	copywin(src, dst, node->scroll, 0, 0, 0, getmaxy(dst) - 1, getmaxx(dst) - 1, 0);
 }
 
+/**
+ * The following is a workaround for a bug in most versions of ncursesw.
+ * Read about it in: http://article.gmane.org/gmane.comp.lib.ncurses.bugs/2751
+ * 
+ * In short, if a panel hides one cell of a multi-cell character, then the rest
+ * of the characters in that line get screwed. The workaround here is to erase
+ * any such character preemptively.
+ *
+ * Caveat: If a wide character is erased, and the panel above it is moved enough
+ * to expose the entire character, it is not always redrawn.
+ */
+static void
+work_around_for_ncurses_bug()
+{
+#ifndef NO_WIDECHAR
+	PANEL *panel = NULL;
+	while ((panel = panel_below(panel)) != NULL) {
+		int sx, ex, sy, ey, w, y;
+		cchar_t ch;
+		PANEL *below = panel;
+
+		sx = panel->win->_begx;
+		ex = panel->win->_maxx + sx;
+		sy = panel->win->_begy;
+		ey = panel->win->_maxy + sy;
+
+		while ((below = panel_below(below)) != NULL) {
+			if (sy > below->win->_begy + below->win->_maxy ||
+					ey < below->win->_begy)
+				continue;
+			if (sx > below->win->_begx + below->win->_maxx ||
+					ex < below->win->_begx)
+				continue;
+			for (y = MAX(sy, below->win->_begy); y <= MIN(ey, below->win->_begy + below->win->_maxy); y++) {
+				if (mvwin_wch(below->win, y - below->win->_begy, sx - 1 - below->win->_begx, &ch) != OK)
+					goto right;
+				w = widestringwidth(ch.chars);
+				if (w > 1 && (ch.attr & 1)) {
+					ch.chars[0] = ' ';
+					ch.attr &= ~ A_CHARTEXT;
+					mvwadd_wch(below->win, y - below->win->_begy, sx - 1 - below->win->_begx, &ch);
+					touchline(below->win, y - below->win->_begy, 1);
+				}
+right:
+				if (mvwin_wch(below->win, y - below->win->_begy, ex + 1 - below->win->_begx, &ch) != OK)
+					continue;
+				w = widestringwidth(ch.chars);
+				if (w > 1 && !(ch.attr & 1)) {
+					ch.chars[0] = ' ';
+					ch.attr &= ~ A_CHARTEXT;
+					mvwadd_wch(below->win, y - below->win->_begy, ex + 1 - below->win->_begx, &ch);
+					touchline(below->win, y - below->win->_begy, 1);
+				}
+			}
+		}
+	}
+#endif
+}
+
 static gboolean
 update_screen(GntWM *wm)
 {
@@ -148,6 +211,7 @@
 			top = top->submenu;
 		}
 	}
+	work_around_for_ncurses_bug();
 	update_panels();
 	doupdate();
 	return TRUE;
--- a/pidgin/plugins/pidginrc.c	Sat May 12 02:40:59 2007 +0000
+++ b/pidgin/plugins/pidginrc.c	Sat May 12 02:43:16 2007 +0000
@@ -61,16 +61,16 @@
 static const char *font_prefs[] = {
 	"/plugins/gtk/purplerc/font/*pidgin_conv_entry",
 	"/plugins/gtk/purplerc/font/*pidgin_conv_imhtml",
-	"/plugins/gtk/purplerc/font/*pidginlog_imhtml",
-	"/plugins/gtk/purplerc/font/*pidginrequest_imhtml",
-	"/plugins/gtk/purplerc/font/*pidginnotify_imhtml",
+	"/plugins/gtk/purplerc/font/*pidgin_log_imhtml",
+	"/plugins/gtk/purplerc/font/*pidgin_request_imhtml",
+	"/plugins/gtk/purplerc/font/*pidgin_notify_imhtml",
 };
 static const char *font_prefs_set[] = {
 	"/plugins/gtk/purplerc/set/font/*pidgin_conv_entry",
 	"/plugins/gtk/purplerc/set/font/*pidgin_conv_imhtml",
-	"/plugins/gtk/purplerc/set/font/*pidginlog_imhtml",
-	"/plugins/gtk/purplerc/set/font/*pidginrequest_imhtml",
-	"/plugins/gtk/purplerc/set/font/*pidginnotify_imhtml",
+	"/plugins/gtk/purplerc/set/font/*pidgin_log_imhtml",
+	"/plugins/gtk/purplerc/set/font/*pidgin_request_imhtml",
+	"/plugins/gtk/purplerc/set/font/*pidgin_notify_imhtml",
 };
 static const char *font_names[] = {
 	N_("Conversation Entry"),
@@ -167,7 +167,7 @@
 				g_string_append_printf(style_string,
 				                       "style \"%s_style\"\n"
 				                       "{font_name = \"%s\"}\n"
-				                       "widget \"%s\""
+				                       "widget \"%s\" "
 				                       "style \"%s_style\"\n",
 				                       prefbase, pref,
 				                       prefbase, prefbase);
@@ -260,7 +260,7 @@
 				g_string_append_printf(style_string,
 				                       "style \"%s_style\"\n"
 				                       "{font_name = \"%s\"}\n"
-				                       "widget \"%s\""
+				                       "widget \"%s\" "
 				                       "style \"%s_style\"\n",
 				                       prefbase, pref,
 				                       prefbase, prefbase);