diff --git a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c index a53280c49..aa93fd1f2 100644 --- a/src/cmd/acme/cols.c +++ b/src/cmd/acme/cols.c @@ -128,9 +128,11 @@ coladd(Column *c, Window *w, Window *clone, int y) w = emalloc(sizeof(Window)); w->col = c; draw(screen, r, textcols[BACK], nil, ZP); + savemouse(w); wininit(w, clone, r); }else{ w->col = c; + savemouse(w); winresize(w, r, FALSE, TRUE); } w->tag.col = c; @@ -147,7 +149,6 @@ coladd(Column *c, Window *w, Window *clone, int y) if(buggered) colresize(c, c->r); - savemouse(w); /* near the button, but in the body */ /* don't move the mouse to the new window if a mouse button is depressed */ if(!mousectl->m.buttons) @@ -164,8 +165,10 @@ colclose(Column *c, Window *w, int dofree) int i, didmouse, up; /* w is locked */ - if(!c->safe) + if(!c->safe){ colgrow(c, w, 1); + winmousebut(w); + } for(i=0; inw; i++) if(c->w[i] == w) goto Found; @@ -469,7 +472,6 @@ colgrow(Column *c, Window *w, int but) free(nl); free(ny); c->safe = TRUE; - winmousebut(w); } void @@ -480,8 +482,9 @@ coldragwin(Column *c, Window *w, int but) Point p, op; Window *v; Column *nc; - - clearmouse(); + if(!but){ + clearmouse(); + } setcursor2(mousectl, &boxcursor, &boxcursor2); b = mouse->buttons; op = mouse->xy; diff --git a/src/cmd/acme/look.c b/src/cmd/acme/look.c index 9c1d1c6b3..14ff21150 100644 --- a/src/cmd/acme/look.c +++ b/src/cmd/acme/look.c @@ -847,8 +847,10 @@ openfile(Text *t, Expand *e) } if(w){ t = &w->body; - if(!t->col->safe && t->fr.maxlines==0) /* window is obscured by full-column window */ + if(!t->col->safe && t->fr.maxlines==0){ /* window is obscured by full-column window */ colgrow(t->col, t->col->w[0], 1); + winmousebut(t->col->w[0]); + } }else{ ow = nil; if(t) diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c index 09422dda0..cba2c52c6 100644 --- a/src/cmd/acme/text.c +++ b/src/cmd/acme/text.c @@ -1112,8 +1112,10 @@ textshow(Text *t, uint q0, uint q1, int doselect) textsetselect(t, q0, q1); return; } - if(t->w!=nil && t->fr.maxlines==0) + if(t->w!=nil && t->fr.maxlines==0){ colgrow(t->col, t->w, 1); + winmousebut(t->w); + } if(doselect) textsetselect(t, q0, q1); qe = t->org+t->fr.nchars; diff --git a/src/cmd/acme/util.c b/src/cmd/acme/util.c index c153f8c18..d0004729f 100644 --- a/src/cmd/acme/util.c +++ b/src/cmd/acme/util.c @@ -491,7 +491,9 @@ makenewwindow(Text *t) y = (bigw->r.min.y + bigw->r.max.y)/2; } w = coladd(c, nil, nil, y); - if(w->body.fr.maxlines < 2) + if(w->body.fr.maxlines < 2){ colgrow(w->col, w, 1); + winmousebut(w); + } return w; }