shithub: riscv

Download patch

ref: 6332fddecd0b9f14a2bc90ded47f7cf74dcb4f20
parent: ad08f0880061cebda5e6b70a0269bb090e0d38bf
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Mon Nov 14 12:53:16 EST 2011

mothra: keep scrolling while mouse buttons are down

--- a/sys/src/cmd/mothra/libpanel/scrollbar.c
+++ b/sys/src/cmd/mothra/libpanel/scrollbar.c
@@ -46,25 +46,23 @@
 	else if(pos>len) pos=len;
 	if(m->buttons&7){
 		g->state=DOWN;
-		if(g->r.min.x<=m->xy.x && m->xy.x<g->r.max.x){
-			sp->buttons=m->buttons;
-			switch(m->buttons){
-			case 1:
-				dy=pos*(sp->hi-sp->lo)/len;
-				pl_sliderupd(g->b, sp->interior, sp->dir, sp->lo-dy,
-					sp->hi-dy);
-				break;
-			case 2:
-				if(g->scrollee && g->scrollee->scroll)
-					g->scrollee->scroll(g->scrollee, sp->dir,
-						m->buttons, pos, len);
-				break;
-			case 4:
-				dy=pos*(sp->hi-sp->lo)/len;
-				pl_sliderupd(g->b, sp->interior, sp->dir, sp->lo+dy,
-					sp->hi+dy);
-				break;
-			}
+		sp->buttons=m->buttons;
+		switch(m->buttons){
+		case 1:
+			dy=pos*(sp->hi-sp->lo)/len;
+			pl_sliderupd(g->b, sp->interior, sp->dir, sp->lo-dy,
+				sp->hi-dy);
+			break;
+		case 2:
+			if(g->scrollee && g->scrollee->scroll)
+				g->scrollee->scroll(g->scrollee, sp->dir,
+					m->buttons, pos, len);
+			break;
+		case 4:
+			dy=pos*(sp->hi-sp->lo)/len;
+			pl_sliderupd(g->b, sp->interior, sp->dir, sp->lo+dy,
+				sp->hi+dy);
+			break;
 		}
 	}
 	else{