# HG changeset patch # User Ryan C. Gordon # Date 1136926355 0 # Node ID 4b2146866b821e90fdfc191659358899a16f977c # Parent 3b8a43c428bbcbd1ee37997dc294ae3e37439e16 Properly restore vidmode when switching back to SDL's virtual terminal with the fbcon driver: Fixes Bugzilla #37. diff -r 3b8a43c428bb -r 4b2146866b82 src/video/fbcon/SDL_fbevents.c --- a/src/video/fbcon/SDL_fbevents.c Sun Jan 08 21:18:15 2006 +0000 +++ b/src/video/fbcon/SDL_fbevents.c Tue Jan 10 20:52:35 2006 +0000 @@ -882,6 +882,7 @@ */ static void switch_vt(_THIS, unsigned short which) { + struct fb_var_screeninfo vinfo; struct vt_stat vtstate; unsigned short v_active; SDL_Surface *screen; @@ -906,6 +907,7 @@ memcpy(screen_contents, screen->pixels, screen_arealen); } FB_SavePaletteTo(this, 256, saved_pal); + ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo); ioctl(keyboard_fd, KDSETMODE, KD_TEXT); /* New console, switch to it */ @@ -923,6 +925,7 @@ /* Restore graphics mode and the contents of the screen */ ioctl(keyboard_fd, KDSETMODE, KD_GRAPHICS); + ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo); FB_RestorePaletteFrom(this, 256, saved_pal); if ( screen_contents ) { memcpy(screen->pixels, screen_contents, screen_arealen);