Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
use typedef'd unsigned type and regular bool type.
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
b2e5e22
..
35f6f16
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-196,8
+196,9
@@
typedef struct {
XIM xim;
XIC xic;
int scr;
XIM xim;
XIC xic;
int scr;
-
B
ool isfixed; /* is fixed geometry? */
+
b
ool isfixed; /* is fixed geometry? */
int fx, fy, fw, fh; /* fixed geometry */
int fx, fy, fw, fh; /* fixed geometry */
+ int tw, th; /* tty width and height */
int w; /* window width */
int h; /* window height */
int ch; /* char height */
int w; /* window width */
int h; /* window height */
int ch; /* char height */
@@
-894,8
+895,8
@@
ttyresize(int x, int y) {
w.ws_row = term.row;
w.ws_col = term.col;
w.ws_row = term.row;
w.ws_col = term.col;
- w.ws_xpixel = xw.w;
- w.ws_ypixel = xw.h;
+ w.ws_xpixel = xw.
t
w;
+ w.ws_ypixel = xw.
t
h;
if(ioctl(cmdfd, TIOCSWINSZ, &w) < 0)
fprintf(stderr, "Couldn't set window size: %s\n", SERRNO);
}
if(ioctl(cmdfd, TIOCSWINSZ, &w) < 0)
fprintf(stderr, "Couldn't set window size: %s\n", SERRNO);
}
@@
-930,7
+931,7
@@
tcursor(int mode) {
void
treset(void) {
void
treset(void) {
- u
nsigned
i;
+ u
int
i;
term.c = (TCursor){{
.mode = ATTR_NULL,
.fg = DefaultFG,
term.c = (TCursor){{
.mode = ATTR_NULL,
.fg = DefaultFG,
@@
-1593,7
+1594,7
@@
strreset(void) {
void
tputtab(bool forward) {
void
tputtab(bool forward) {
- u
nsigned
x = term.c.x;
+ u
int
x = term.c.x;
if(forward) {
if(x == term.col)
if(forward) {
if(x == term.col)
@@
-1837,8
+1838,8
@@
tresize(int col, int row) {
void
xresize(int col, int row) {
void
xresize(int col, int row) {
- xw.w = MAX(1, 2*BORDER + col * xw.cw);
- xw.h = MAX(1, 2*BORDER + row * xw.ch);
+ xw.
t
w = MAX(1, 2*BORDER + col * xw.cw);
+ xw.
t
h = MAX(1, 2*BORDER + row * xw.ch);
}
void
}
void
@@
-2142,6
+2143,8
@@
xresettitle(void) {
void
redraw(void) {
struct timespec tv = {0, REDRAW_TIMEOUT * 1000};
void
redraw(void) {
struct timespec tv = {0, REDRAW_TIMEOUT * 1000};
+
+ xclear(0, 0, xw.w, xw.h);
tfulldirt();
draw();
XSync(xw.dpy, False); /* necessary for a good tput flash */
tfulldirt();
draw();
XSync(xw.dpy, False); /* necessary for a good tput flash */
@@
-2331,6
+2334,8
@@
resize(XEvent *e) {
row = (xw.h - 2*BORDER) / xw.ch;
if(col == term.col && row == term.row)
return;
row = (xw.h - 2*BORDER) / xw.ch;
if(col == term.col && row == term.row)
return;
+
+ xclear(0, 0, xw.w, xw.h);
tresize(col, row);
xresize(col, row);
ttyresize(col, row);
tresize(col, row);
xresize(col, row);
ttyresize(col, row);
@@
-2388,7
+2393,7
@@
run(void) {
int
main(int argc, char *argv[]) {
int i, bitm, xr, yr;
int
main(int argc, char *argv[]) {
int i, bitm, xr, yr;
- u
nsigned
int wr, hr;
+ uint wr, hr;
xw.fw = xw.fh = xw.fx = xw.fy = 0;
xw.isfixed = False;
xw.fw = xw.fh = xw.fx = xw.fy = 0;
xw.isfixed = False;