From: John Hodge Date: Mon, 2 Aug 2010 01:22:13 +0000 (+0800) Subject: Fixed mode switch behavior X-Git-Tag: rel0.06~63 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=63bd7149b4e48db1d236dff264a7dfe5286930fe;p=tpg%2Facess2.git Fixed mode switch behavior --- diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index b2db41f1..805ce7b0 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -472,10 +472,18 @@ int VT_Terminal_IOCtl(tVFS_Node *Node, int Id, void *Data) // Update mode if needed if( term->Mode != *iData - || term->Width != term->NewWidth - || term->Height != term->NewHeight) + || term->NewWidth + || term->NewHeight) { + if( *iData == TERM_MODE_TEXT ) { + term->NewHeight *= giVT_CharHeight; + term->NewWidth *= giVT_CharWidth; + } + if(term->NewHeight == 0) term->NewHeight = term->Height; + if(term->NewWidth == 0) term->NewWidth = term->Width; VT_int_ChangeMode(term, *iData, term->NewWidth, term->NewHeight); + term->NewWidth = 0; + term->NewHeight = 0; } // Update the screen dimensions