diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-08-31 14:52:52 +0200 |
---|---|---|
committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-08-31 14:52:52 +0200 |
commit | 80f70f1c224ec6fb10f04c29ea2205f47ae553ff (patch) | |
tree | 390b224c764cca1b6cd2ee5502f2e012f9c3e157 /st.c | |
parent | 23cc3fc5715a650c91e3b99074c31aaf63e2102c (diff) | |
download | st-80f70f1c224ec6fb10f04c29ea2205f47ae553ff.tar.gz st-80f70f1c224ec6fb10f04c29ea2205f47ae553ff.zip |
use GLYPH_SET to test if a char is set; cleanup.
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -245,7 +245,7 @@ static char *getseltext() { | |||
245 | ptr = str = malloc (sz); | 245 | ptr = str = malloc (sz); |
246 | for(y = 0; y < term.row; y++) { | 246 | for(y = 0; y < term.row; y++) { |
247 | for(x = 0; x < term.col; x++) { | 247 | for(x = 0; x < term.col; x++) { |
248 | if(term.line[y][x].c && (ls=selected(x, y))) { | 248 | if(term.line[y][x].state & GLYPH_SET && (ls=selected(x, y))) { |
249 | *ptr = term.line[y][x].c; | 249 | *ptr = term.line[y][x].c; |
250 | ptr++; | 250 | ptr++; |
251 | } | 251 | } |
@@ -1421,11 +1421,9 @@ resize(XEvent *e) { | |||
1421 | row = xw.bufh / xw.ch; | 1421 | row = xw.bufh / xw.ch; |
1422 | tresize(col, row); | 1422 | tresize(col, row); |
1423 | ttyresize(col, row); | 1423 | ttyresize(col, row); |
1424 | xw.bufh = MAX(1, xw.bufh); | ||
1425 | xw.bufw = MAX(1, xw.bufw); | ||
1424 | XFreePixmap(xw.dis, xw.buf); | 1426 | XFreePixmap(xw.dis, xw.buf); |
1425 | if(xw.bufh<1) | ||
1426 | xw.bufh = 1; | ||
1427 | if(xw.bufw<1) | ||
1428 | xw.bufw = 1; | ||
1429 | xw.buf = XCreatePixmap(xw.dis, xw.win, xw.bufw, xw.bufh, XDefaultDepth(xw.dis, xw.scr)); | 1427 | xw.buf = XCreatePixmap(xw.dis, xw.win, xw.bufw, xw.bufh, XDefaultDepth(xw.dis, xw.scr)); |
1430 | draw(SCREEN_REDRAW); | 1428 | draw(SCREEN_REDRAW); |
1431 | } | 1429 | } |
@@ -1435,7 +1433,9 @@ run(void) { | |||
1435 | XEvent ev; | 1433 | XEvent ev; |
1436 | fd_set rfd; | 1434 | fd_set rfd; |
1437 | int xfd = XConnectionNumber(xw.dis); | 1435 | int xfd = XConnectionNumber(xw.dis); |
1438 | long mask = ExposureMask | KeyPressMask | StructureNotifyMask | FocusChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask; | 1436 | long mask = ExposureMask | KeyPressMask | StructureNotifyMask |
1437 | | FocusChangeMask | PointerMotionMask | ButtonPressMask | ||
1438 | | ButtonReleaseMask; | ||
1439 | 1439 | ||
1440 | XSelectInput(xw.dis, xw.win, mask); | 1440 | XSelectInput(xw.dis, xw.win, mask); |
1441 | XResizeWindow(xw.dis, xw.win, xw.w, xw.h); /* XXX: fix resize bug in wmii (?) */ | 1441 | XResizeWindow(xw.dis, xw.win, xw.w, xw.h); /* XXX: fix resize bug in wmii (?) */ |