mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
do the resize signally properly
This commit is contained in:
parent
df330f33fd
commit
5195c065c6
1 changed files with 12 additions and 11 deletions
|
@ -69,6 +69,7 @@ static WINDOW *output;
|
||||||
static WINDOW *status;
|
static WINDOW *status;
|
||||||
static WINDOW *input;
|
static WINDOW *input;
|
||||||
static int screen_x, screen_y;
|
static int screen_x, screen_y;
|
||||||
|
static int interrupted;
|
||||||
|
|
||||||
#define MAXCMDLINE 256
|
#define MAXCMDLINE 256
|
||||||
static inputline_t *input_line;
|
static inputline_t *input_line;
|
||||||
|
@ -111,7 +112,7 @@ C_ExecLine (const char *line)
|
||||||
static void
|
static void
|
||||||
sigwinch (int sig)
|
sigwinch (int sig)
|
||||||
{
|
{
|
||||||
ungetch (KEY_RESIZE);
|
interrupted = 1;
|
||||||
signal (SIGWINCH, sigwinch);
|
signal (SIGWINCH, sigwinch);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -231,17 +232,17 @@ C_ProcessInput (void)
|
||||||
int ch = wgetch (input), i;
|
int ch = wgetch (input), i;
|
||||||
const char *text;
|
const char *text;
|
||||||
|
|
||||||
switch (ch) {
|
if (interrupted) {
|
||||||
case KEY_RESIZE:
|
|
||||||
{
|
|
||||||
struct winsize size;
|
struct winsize size;
|
||||||
|
|
||||||
|
interrupted = 0;
|
||||||
if (ioctl (fileno (stdout), TIOCGWINSZ, &size) == 0) {
|
if (ioctl (fileno (stdout), TIOCGWINSZ, &size) == 0) {
|
||||||
resizeterm (size.ws_row, size.ws_col);
|
resizeterm (size.ws_row, size.ws_col);
|
||||||
wrefresh (curscr);
|
wrefresh (curscr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
switch (ch) {
|
||||||
case KEY_ENTER:
|
case KEY_ENTER:
|
||||||
case '\n':
|
case '\n':
|
||||||
case '\r':
|
case '\r':
|
||||||
|
|
Loading…
Reference in a new issue