Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/cmd/acme/cols.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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; i<c->nw; i++)
if(c->w[i] == w)
goto Found;
Expand Down Expand Up @@ -469,7 +472,6 @@ colgrow(Column *c, Window *w, int but)
free(nl);
free(ny);
c->safe = TRUE;
winmousebut(w);
}

void
Expand All @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/acme/look.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/acme/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/acme/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}