git: 9front

Download patch

ref: 91580d40ff086d985333549e8f6bf2a2ae952655
parent: ba6d694a08364b1f937570635d5fb2acbac033db
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sat Oct 20 06:38:11 EDT 2012

rio: wtop() after resize fix

wtop() checked w->topped == topped as a fast exit. if you
had the top most window not being current (== input) which
can happen when you delete the current window, then wtop would
after resize would not make the window current because it
is already top topmost one. wtopme() and wcurrent() both are
non-ops when window is already the topmost or window is already
current, so remove the check as its not needed. also topping
the window feels less sluggish.

--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -1220,8 +1220,8 @@
 	for(j=0; j<nwindow; j++)
 		if(window[j] == w){
 			incref(w);
-			wcurrent(w);
 			wtopme(w);
+			wcurrent(w);
 			wclose(w);
 			return;
 		}
--- a/sys/src/cmd/rio/wind.c
+++ b/sys/src/cmd/rio/wind.c
@@ -1311,11 +1311,9 @@
 
 	w = wpointto(pt);
 	if(w){
-		if(w->topped == topped)
-			return nil;
 		incref(w);
-		wcurrent(w);
 		wtopme(w);
+		wcurrent(w);
 		wclose(w);
 	}
 	return w;
--