mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 12:05:47 +08:00
Cygwin: pty: Prevent meaningless ResizePseudoConsole() calls.
- This patch prevents to call ResizePseudoConsole() unless the pty is resized.
This commit is contained in:
parent
fe59ac0da7
commit
896f6dc387
@ -2615,6 +2615,9 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg)
|
|||||||
*(struct winsize *) arg = get_ttyp ()->winsize;
|
*(struct winsize *) arg = get_ttyp ()->winsize;
|
||||||
break;
|
break;
|
||||||
case TIOCSWINSZ:
|
case TIOCSWINSZ:
|
||||||
|
if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
|
||||||
|
|| get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
|
||||||
|
{
|
||||||
/* FIXME: Pseudo console can be accessed via its handle
|
/* FIXME: Pseudo console can be accessed via its handle
|
||||||
only in the process which created it. What else can we do? */
|
only in the process which created it. What else can we do? */
|
||||||
if (get_pseudo_console () && get_ttyp ()->master_pid == myself->pid)
|
if (get_pseudo_console () && get_ttyp ()->master_pid == myself->pid)
|
||||||
@ -2624,9 +2627,6 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg)
|
|||||||
size.Y = ((struct winsize *) arg)->ws_row;
|
size.Y = ((struct winsize *) arg)->ws_row;
|
||||||
ResizePseudoConsole (get_pseudo_console (), size);
|
ResizePseudoConsole (get_pseudo_console (), size);
|
||||||
}
|
}
|
||||||
if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
|
|
||||||
|| get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
|
|
||||||
{
|
|
||||||
get_ttyp ()->winsize = *(struct winsize *) arg;
|
get_ttyp ()->winsize = *(struct winsize *) arg;
|
||||||
get_ttyp ()->kill_pgrp (SIGWINCH);
|
get_ttyp ()->kill_pgrp (SIGWINCH);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user