git: 9front

Download patch

ref: 515c1ede50b3882748d0c3612a7bdfd62a4433fd
parent: 9e95cbb8924986f5fc3e1ebe94419f3a9571567e
author: stanley lieber <stanley.lieber@gmail.com>
date: Tue Apr 24 15:53:05 EDT 2012

samterm: cleanup

--- a/sys/src/cmd/samterm/main.c
+++ b/sys/src/cmd/samterm/main.c
@@ -75,7 +75,8 @@
 				continue;
 			}
 			nwhich = flwhich(mousep->xy);
-			scr = which && ptinrect(mousep->xy, which->scroll);
+			scr = which && (ptinrect(mousep->xy, which->scroll) ||
+				mousep->buttons&(8|16));
 			if(mousep->buttons)
 				flushtyping(1);
 			if((mousep->buttons&1)==0)
@@ -94,11 +95,11 @@
 						chord &= ~4;
 					}
 				}
-			} else if(mousep->buttons&1 || mousep->buttons&8){
+			}else if(mousep->buttons&(1|8)){
 				if(nwhich){
 					if(nwhich!=which)
 						current(nwhich);
-					else if(scr || mousep->buttons&8)
+					else if(scr)
 						scroll(which, 1);
 					else{
 						t=(Text *)which->user1;
@@ -116,8 +117,8 @@
 					scroll(which, 2);
 				else
 					menu2hit();
-			}else if((mousep->buttons&4 || mousep->buttons&16)){
-				if(scr || mousep->buttons&16)
+			}else if(mousep->buttons&(4|16)){
+				if(scr)
 					scroll(which, 3);
 				else
 					menu3hit();
--