diff options
author | sobomax <sobomax@FreeBSD.org> | 2001-05-19 17:05:52 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2001-05-19 17:05:52 +0000 |
commit | a6b112d052e7561b77b7d3cf0466e18ee2b1efb7 (patch) | |
tree | bde33b01361cef554fcf40238c0c7e1650a8600f | |
parent | 197d190ffbf24b9ffb715b21d6bdf0aeed8eb65f (diff) | |
download | FreeBSD-src-a6b112d052e7561b77b7d3cf0466e18ee2b1efb7.zip FreeBSD-src-a6b112d052e7561b77b7d3cf0466e18ee2b1efb7.tar.gz |
Use CONS_GETINFO ioctl to get geometry of the current text mode instead of
TIOCGWINSZ. The former is more correct in this context.
-rw-r--r-- | lib/libvgl/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libvgl/main.c b/lib/libvgl/main.c index d1cab57..6522230 100644 --- a/lib/libvgl/main.c +++ b/lib/libvgl/main.c @@ -57,7 +57,7 @@ static int VGLSwitchPending; static int VGLOnDisplay; static unsigned int VGLCurWindow; static int VGLInitDone = 0; -static struct winsize VGLOldWSize; +static vid_info_t VGLOldVInfo; void VGLEnd() @@ -80,8 +80,8 @@ struct vt_mode smode; ioctl(0, _IO('V', VGLOldMode - M_VESA_BASE), 0); if (VGLOldMode == M_VESA_800x600) { int size[3]; - size[0] = VGLOldWSize.ws_col; - size[1] = VGLOldWSize.ws_row; + size[0] = VGLOldVInfo.mv_csz; + size[1] = VGLOldVInfo.mv_rsz; size[2] = 16; ioctl(0, KDRASTER, size); } @@ -146,9 +146,11 @@ VGLInit(int mode) return -1; /* If current mode is VESA_800x600 then save its geometry to restore later */ - if ((VGLOldMode >= M_VESA_BASE) && (VGLOldMode == M_VESA_800x600)) - if (ioctl(0, TIOCGWINSZ, &VGLOldWSize)) + if ((VGLOldMode >= M_VESA_BASE) && (VGLOldMode == M_VESA_800x600)) { + VGLOldVInfo.size = sizeof(VGLOldVInfo); + if (ioctl(0, CONS_GETINFO, &VGLOldVInfo)) return -1; + } VGLDisplay = (VGLBitmap *)malloc(sizeof(VGLBitmap)); if (VGLDisplay == NULL) |