From 63bd7149b4e48db1d236dff264a7dfe5286930fe Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 2 Aug 2010 09:22:13 +0800 Subject: [PATCH] Fixed mode switch behavior --- Kernel/drv/vterm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 -- 2.20.1