aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-09-24 11:04:26 +0200
committerChristoph Lohmann <20h@r-36.net>2012-09-24 11:04:26 +0200
commitd68253ec75021c4e3fde86ed63065d68572929be (patch)
treec7acbfa804768dddd2579e9d29f78d9708770d90
parent71fc293de214646f76a24b3a452a227837b8cbef (diff)
downloadst-patched-d68253ec75021c4e3fde86ed63065d68572929be.tar.bz2
st-patched-d68253ec75021c4e3fde86ed63065d68572929be.tar.xz
st-patched-d68253ec75021c4e3fde86ed63065d68572929be.zip
The xinit() call needs to be behind all the tty init, otherwise all the
allocated structures are wrong. The xclear() is now done on purpose. Please keep X11 calls out of the way of pure tty-related calls.
-rw-r--r--st.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/st.c b/st.c
index 9760b6c..2d080e5 100644
--- a/st.c
+++ b/st.c
@@ -953,7 +953,7 @@ treset(void) {
953 term.tabs[i] = 1; 953 term.tabs[i] = 1;
954 term.top = 0, term.bot = term.row - 1; 954 term.top = 0, term.bot = term.row - 1;
955 term.mode = MODE_WRAP; 955 term.mode = MODE_WRAP;
956 xclear(0, 0, xw.w, xw.h); 956
957 tclearregion(0, 0, term.col-1, term.row-1); 957 tclearregion(0, 0, term.col-1, term.row-1);
958} 958}
959 959
@@ -1728,6 +1728,7 @@ tputc(char *c) {
1728 case 'c': /* RIS -- Reset to inital state */ 1728 case 'c': /* RIS -- Reset to inital state */
1729 treset(); 1729 treset();
1730 term.esc = 0; 1730 term.esc = 0;
1731 xclear(0, 0, xw.w, xw.h);
1731 xresettitle(); 1732 xresettitle();
1732 break; 1733 break;
1733 case '=': /* DECPAM -- Application keypad */ 1734 case '=': /* DECPAM -- Application keypad */
@@ -2456,9 +2457,9 @@ main(int argc, char *argv[]) {
2456 2457
2457 run: 2458 run:
2458 setlocale(LC_CTYPE, ""); 2459 setlocale(LC_CTYPE, "");
2459 xinit();
2460 tnew(80, 24); 2460 tnew(80, 24);
2461 ttynew(); 2461 ttynew();
2462 xinit();
2462 selinit(); 2463 selinit();
2463 run(); 2464 run();
2464 return 0; 2465 return 0;