Pass new dimensions into ttyresize
This removes another reference to TermWindow from st.c. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
This commit is contained in:
		
							parent
							
								
									a8314643b1
								
							
						
					
					
						commit
						dbe8676d7d
					
				
							
								
								
									
										6
									
								
								st.c
								
								
								
								
							
							
						
						
									
										6
									
								
								st.c
								
								
								
								
							| 
						 | 
					@ -905,14 +905,14 @@ ttysend(char *s, size_t n)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
ttyresize(void)
 | 
					ttyresize(int tw, int th)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct winsize w;
 | 
						struct winsize w;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	w.ws_row = term.row;
 | 
						w.ws_row = term.row;
 | 
				
			||||||
	w.ws_col = term.col;
 | 
						w.ws_col = term.col;
 | 
				
			||||||
	w.ws_xpixel = win.tw;
 | 
						w.ws_xpixel = tw;
 | 
				
			||||||
	w.ws_ypixel = win.th;
 | 
						w.ws_ypixel = th;
 | 
				
			||||||
	if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0)
 | 
						if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0)
 | 
				
			||||||
		fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno));
 | 
							fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								st.h
								
								
								
								
							
							
						
						
									
										2
									
								
								st.h
								
								
								
								
							| 
						 | 
					@ -187,7 +187,7 @@ void tsetdirtattr(int);
 | 
				
			||||||
int match(uint, uint);
 | 
					int match(uint, uint);
 | 
				
			||||||
void ttynew(void);
 | 
					void ttynew(void);
 | 
				
			||||||
size_t ttyread(void);
 | 
					size_t ttyread(void);
 | 
				
			||||||
void ttyresize(void);
 | 
					void ttyresize(int, int);
 | 
				
			||||||
void ttysend(char *, size_t);
 | 
					void ttysend(char *, size_t);
 | 
				
			||||||
void ttywrite(const char *, size_t);
 | 
					void ttywrite(const char *, size_t);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								x.c
								
								
								
								
							
							
						
						
									
										6
									
								
								x.c
								
								
								
								
							| 
						 | 
					@ -192,7 +192,7 @@ zoomabs(const Arg *arg)
 | 
				
			||||||
	xunloadfonts();
 | 
						xunloadfonts();
 | 
				
			||||||
	xloadfonts(usedfont, arg->f);
 | 
						xloadfonts(usedfont, arg->f);
 | 
				
			||||||
	cresize(0, 0);
 | 
						cresize(0, 0);
 | 
				
			||||||
	ttyresize();
 | 
						ttyresize(win.tw, win.th);
 | 
				
			||||||
	redraw();
 | 
						redraw();
 | 
				
			||||||
	xhints();
 | 
						xhints();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1679,7 +1679,7 @@ resize(XEvent *e)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cresize(e->xconfigure.width, e->xconfigure.height);
 | 
						cresize(e->xconfigure.width, e->xconfigure.height);
 | 
				
			||||||
	ttyresize();
 | 
						ttyresize(win.tw, win.th);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
| 
						 | 
					@ -1710,7 +1710,7 @@ run(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cresize(w, h);
 | 
						cresize(w, h);
 | 
				
			||||||
	ttynew();
 | 
						ttynew();
 | 
				
			||||||
	ttyresize();
 | 
						ttyresize(win.tw, win.th);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	clock_gettime(CLOCK_MONOTONIC, &last);
 | 
						clock_gettime(CLOCK_MONOTONIC, &last);
 | 
				
			||||||
	lastblink = last;
 | 
						lastblink = last;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue