mirror of
https://github.com/alrayyes/st
synced 2023-11-14 15:56:30 +00:00
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.
This commit is contained in:
parent
6fc471ccc6
commit
fbc589d506
4
TODO
4
TODO
@ -26,10 +26,6 @@ bugs
|
|||||||
* fix rows and column definition in fixed geometry
|
* fix rows and column definition in fixed geometry
|
||||||
* fix -e handling
|
* fix -e handling
|
||||||
* remove DEC test sequence when appropriate
|
* 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
|
misc
|
||||||
----
|
----
|
||||||
|
21
st.c
21
st.c
@ -3520,10 +3520,28 @@ resize(XEvent *e) {
|
|||||||
void
|
void
|
||||||
run(void) {
|
run(void) {
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
int w = xw.w, h = xw.h;
|
||||||
fd_set rfd;
|
fd_set rfd;
|
||||||
int xfd = XConnectionNumber(xw.dpy), xev, blinkset = 0, dodraw = 0;
|
int xfd = XConnectionNumber(xw.dpy), xev, blinkset = 0, dodraw = 0;
|
||||||
struct timeval drawtimeout, *tv = NULL, now, last, lastblink;
|
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(&lastblink, NULL);
|
||||||
gettimeofday(&last, NULL);
|
gettimeofday(&last, NULL);
|
||||||
|
|
||||||
@ -3673,10 +3691,7 @@ run:
|
|||||||
XSetLocaleModifiers("");
|
XSetLocaleModifiers("");
|
||||||
tnew(80, 24);
|
tnew(80, 24);
|
||||||
xinit();
|
xinit();
|
||||||
ttynew();
|
|
||||||
selinit();
|
selinit();
|
||||||
if(xw.isfixed)
|
|
||||||
cresize(xw.h, xw.w);
|
|
||||||
run();
|
run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user