[PATCH driver/vesa] Restore palette on LeaveVT()

Egbert Eich eich at freedesktop.org
Wed Jul 31 02:37:52 PDT 2013


Use BIOS function to restore palette on LeaveVT().
This fixes messed up colors in text mode on VT switch.
It is already done in CloseScreen().

Signed-off-by: Egbert Eich <eich at freedesktop.org>
---
 src/vesa.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/vesa.c b/src/vesa.c
index 93b4909..1780a3b 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -1133,7 +1133,12 @@ static void
 VESALeaveVT(VT_FUNC_ARGS_DECL)
 {
     SCRN_INFO_PTR(arg);
+    VESAPtr pVesa = VESAGetRec(pScrn);
+
     VESASaveRestore(pScrn, MODE_RESTORE);
+    if (pVesa->savedPal)
+	VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256,
+			     pVesa->savedPal, FALSE, TRUE);
 }
 
 static Bool
-- 
1.8.1.4



More information about the xorg-devel mailing list