git: 9front

Download patch

ref: 40edc7d89d922e038d9b5422ecf9dc94b6e447f0
parent: 76edefa7e07e894383dea96a69df5aa00d905a7d
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Tue Oct 30 19:18:53 EDT 2012

rio: fix topping a hidden window does not activate the foreground font color

--- a/sys/src/cmd/rio/dat.h
+++ b/sys/src/cmd/rio/dat.h
@@ -222,7 +222,7 @@
 void		wshow(Window*, uint);
 void		wsnarf(Window*);
 void 		wscrsleep(Window*, uint);
-void		wsetcols(Window*);
+void		wsetcols(Window*, int);
 
 struct Dirtab
 {
--- a/sys/src/cmd/rio/wind.c
+++ b/sys/src/cmd/rio/wind.c
@@ -105,7 +105,7 @@
 	else{
 		frclear(w, FALSE);
 		frinit(w, r, w->font, w->i, cols);
-		wsetcols(w);
+		wsetcols(w, 1);
 		w->maxtab = maxtab*stringwidth(w->font, "0");
 		r = insetrect(w->i->r, Selborder);
 		draw(w->i, r, cols[BACK], nil, w->entire.min);
@@ -710,15 +710,15 @@
 }
 
 void
-wsetcols(Window *w)
+wsetcols(Window *w, int topped)
 {
 	if(w->holding)
-		if(w == input)
+		if(topped)
 			w->cols[TEXT] = w->cols[HTEXT] = holdcol;
 		else
 			w->cols[TEXT] = w->cols[HTEXT] = lightholdcol;
 	else
-		if(w == input)
+		if(topped)
 			w->cols[TEXT] = w->cols[HTEXT] = cols[TEXT];
 		else
 			w->cols[TEXT] = w->cols[HTEXT] = paletextcol;
@@ -727,7 +727,7 @@
 void
 wrepaint(Window *w)
 {
-	wsetcols(w);
+	wsetcols(w, w == input);
 	if(!w->mouseopen)
 		frredraw(w);
 	if(w == input)
--