shithub: picker

Download patch

ref: ffb97abccf0d8a01cf7db41c495103585d810699
parent: a6de205ab4f439041b54d3fcb76092efbe0bb50d
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Jun 26 08:23:46 EDT 2020

fix plumbing

--- a/picker.c
+++ b/picker.c
@@ -125,6 +125,7 @@
 static Space *space;
 static Image *bg;
 static char hex[12];
+static int once;
 
 static ulong
 rgba2u(double *rgba)
@@ -414,6 +415,7 @@
 		}
 
 		if (c == nil) {
+			c = new;
 			if (last != nil)
 				last->next = new;
 			new->prev = last;
@@ -425,6 +427,8 @@
 			ncolors++;
 		}
 
+		if (!once)
+			printcolor(1, c);
 		unlockdisplay(display);
 		sendul(loaded, 0);
 	}
@@ -460,7 +464,6 @@
 	if ((f = plumbopen("picker", OREAD)) >= 0) {
 		while ((m = plumbrecv(f)) != nil) {
 			loadtheme(m->data);
-			dump(1);
 			plumbfree(m);
 		}
 	}
@@ -484,7 +487,7 @@
 		[Cloaded] = { nil, nil, CHANRCV },
 		{ nil, nil, CHANEND },
 	};
-	int i, once, oldbuttons, slider;
+	int i, oldbuttons, slider;
 	ulong u;
 	char buf[16];
 
@@ -491,7 +494,6 @@
 	fmtinstall(L'©', colorfmt);
 
 	space = &spaces[0];
-	once = 0;
 	ARGBEGIN{
 	case 'e':
 		once = 1;