struct {int x, y;} b, e;
char *clip;
Atom xtarget;
+ bool alt;
struct timeval tclick1;
struct timeval tclick2;
} Selection;
}
*ptr = 0;
}
+ sel.alt = IS_SET(MODE_ALTSCREEN);
xsetsel(str);
}
cmdfd = m;
signal(SIGCHLD, sigchld);
if (opt_io && !(fileio = fopen(opt_io, "w"))) {
- fprintf(stderr, "Error opening %s:%s",
+ fprintf(stderr, "Error opening %s:%s\n",
opt_io, strerror(errno));
}
}
/* adjust fixed window geometry */
if(xw.isfixed) {
sw = DisplayWidth(xw.dpy, xw.scr);
- sh = DisplayWidth(xw.dpy, xw.scr);
+ sh = DisplayHeight(xw.dpy, xw.scr);
if(xw.fx < 0)
- xw.fx = sw + xw.fx - xw.fw;
+ xw.fx = sw + xw.fx - xw.fw - 1;
if(xw.fy < 0)
- xw.fy = sh + xw.fy - xw.fh;
+ xw.fy = sh + xw.fy - xw.fh - 1;
} else {
/* window - default size */
xw.h = 2*BORDER + term.row * xw.ch;
int ic, ib, x, y, ox, sl;
Glyph base, new;
char buf[DRAW_BUF_SIZ];
+ bool ena_sel = sel.bx != -1, alt = IS_SET(MODE_ALTSCREEN);
+ if((sel.alt && !alt) || (!sel.alt && alt))
+ ena_sel = 0;
if(!(xw.state & WIN_VISIBLE))
return;
ic = ib = ox = 0;
for(x = x1; x < x2; x++) {
new = term.line[y][x];
- if(sel.bx != -1 && *(new.c) && selected(x, y))
+ if(ena_sel && *(new.c) && selected(x, y))
new.mode ^= ATTR_REVERSE;
if(ib > 0 && (!(new.state & GLYPH_SET) || ATTRCMP(base, new) ||
ib >= DRAW_BUF_SIZ-UTF_SIZ)) {