finch/libgnt/gntwm.c

branch
release-2.x.y
changeset 35986
5dc98ddc6a9a
parent 35563
922e7abddb4d
child 35989
2b5a26ddbb69
child 35991
e6937e52930b
--- a/finch/libgnt/gntwm.c	Tue May 06 15:06:30 2014 +0200
+++ b/finch/libgnt/gntwm.c	Tue May 06 15:17:11 2014 +0200
@@ -776,14 +776,16 @@
 			if ((now & A_COLOR) != (old & A_COLOR) ||
 				(now & A_REVERSE) != (old & A_REVERSE))
 			{
-				int ret;
 				short fgp, bgp, r, g, b;
 				struct
 				{
 					int r, g, b;
 				} fg, bg;
 
-				ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp);
+				if (pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp) != OK) {
+					fgp = -1;
+					bgp = -1;
+				}
 				if (fgp == -1)
 					fgp = COLOR_BLACK;
 				if (bgp == -1)
@@ -794,9 +796,13 @@
 					fgp = bgp;
 					bgp = tmp;
 				}
-				ret = color_content(fgp, &r, &g, &b);
+				if (color_content(fgp, &r, &g, &b) != OK) {
+					r = g = b = 0;
+				}
 				fg.r = r; fg.b = b; fg.g = g;
-				ret = color_content(bgp, &r, &g, &b);
+				if (color_content(bgp, &r, &g, &b) != OK) {
+					r = g = b = 255;
+				}
 				bg.r = r; bg.b = b; bg.g = g;
 #define ADJUST(x) (x = x * 255 / 1000)
 				ADJUST(fg.r);
@@ -1144,13 +1150,11 @@
 {
 	static GntWidget *clip;
 	gchar *text;
-	int maxx, maxy;
 	if (clip) {
 		gnt_widget_destroy(clip);
 		clip = NULL;
 		return TRUE;
 	}
-	getmaxyx(stdscr, maxy, maxx);
 	text = gnt_get_clipboard_string();
 	clip = gnt_hwindow_new(FALSE);
 	GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT);

mercurial