aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sedov2013-06-23 21:05:29 +0400
committerRoberto E. Vargas Caballero2013-07-04 09:36:22 +0200
commit1967a0d57176af06ed42c65c1332d2f7655b4982 (patch)
tree306195eea935309871b9932d04eddc952f8a194e
parent74c453dfd19419b0e28b36128bf6c13db47df911 (diff)
downloadaur-1967a0d57176af06ed42c65c1332d2f7655b4982.tar.gz
Remove long text being cropped/wrapped to standard 80x24 on launch.
To be more specific, now tty creation is delayed until X window is actually mapped; last ConfigureNotify before mapping determines initial tty size. Please report problems if there are any.
-rw-r--r--TODO4
-rw-r--r--st.c21
2 files changed, 18 insertions, 7 deletions
diff --git a/TODO b/TODO
index afd6401912fa..4fc13461e8b9 100644
--- a/TODO
+++ b/TODO
@@ -26,10 +26,6 @@ bugs
* fix rows and column definition in fixed geometry
* fix -e handling
* remove DEC test sequence when appropriate
-* When some application outputting long text is run in the shell init scripts,
- then this text might be stripped to the standard 80x25 due to st running the
- virtual terminal at first priority. Maybe the vt initialisation could be
- moved somewhere after knowing the right window size.
misc
----
diff --git a/st.c b/st.c
index ac1954e4a20e..0fc724b2dc43 100644
--- a/st.c
+++ b/st.c
@@ -3520,10 +3520,28 @@ resize(XEvent *e) {
void
run(void) {
XEvent ev;
+ int w = xw.w, h = xw.h;
fd_set rfd;
int xfd = XConnectionNumber(xw.dpy), xev, blinkset = 0, dodraw = 0;
struct timeval drawtimeout, *tv = NULL, now, last, lastblink;
+ /* Waiting for window mapping */
+ while(1) {
+ XNextEvent(xw.dpy, &ev);
+ if(ev.type == ConfigureNotify) {
+ w = ev.xconfigure.width;
+ h = ev.xconfigure.height;
+ } else if(ev.type == MapNotify) {
+ break;
+ }
+ }
+
+ if(!xw.isfixed)
+ cresize(w, h);
+ else
+ cresize(xw.fw, xw.fh);
+ ttynew();
+
gettimeofday(&lastblink, NULL);
gettimeofday(&last, NULL);
@@ -3673,10 +3691,7 @@ run:
XSetLocaleModifiers("");
tnew(80, 24);
xinit();
- ttynew();
selinit();
- if(xw.isfixed)
- cresize(xw.h, xw.w);
run();
return 0;