Fix missing restoring of the mouse cursor position, the border color and the
blank state after a screen switch.
This commit is contained in:
parent
a8083b9c0b
commit
e848f3d19c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346486
@ -436,6 +436,9 @@ VGLCheckSwitch()
|
|||||||
VGLDisplay->Xsize = VGLModeInfo.vi_width;
|
VGLDisplay->Xsize = VGLModeInfo.vi_width;
|
||||||
VGLDisplay->Ysize = VGLModeInfo.vi_height;
|
VGLDisplay->Ysize = VGLModeInfo.vi_height;
|
||||||
VGLSetVScreenSize(VGLDisplay, VGLDisplay->VXsize, VGLDisplay->VYsize);
|
VGLSetVScreenSize(VGLDisplay, VGLDisplay->VXsize, VGLDisplay->VYsize);
|
||||||
|
VGLRestoreBlank();
|
||||||
|
VGLRestoreBorder();
|
||||||
|
VGLMouseRestore();
|
||||||
VGLPanScreen(VGLDisplay, VGLDisplay->Xorigin, VGLDisplay->Yorigin);
|
VGLPanScreen(VGLDisplay, VGLDisplay->Xorigin, VGLDisplay->Yorigin);
|
||||||
switch (VGLDisplay->Type) {
|
switch (VGLDisplay->Type) {
|
||||||
case VIDBUF4S:
|
case VIDBUF4S:
|
||||||
|
@ -272,6 +272,22 @@ VGLMouseInit(int mode)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
VGLMouseRestore(void)
|
||||||
|
{
|
||||||
|
struct mouse_info mouseinfo;
|
||||||
|
|
||||||
|
INTOFF();
|
||||||
|
mouseinfo.operation = MOUSE_GETINFO;
|
||||||
|
if (ioctl(0, CONS_MOUSECTL, &mouseinfo) == 0) {
|
||||||
|
mouseinfo.operation = MOUSE_MOVEABS;
|
||||||
|
mouseinfo.u.data.x = VGLMouseXpos;
|
||||||
|
mouseinfo.u.data.y = VGLMouseYpos;
|
||||||
|
ioctl(0, CONS_MOUSECTL, &mouseinfo);
|
||||||
|
}
|
||||||
|
INTON();
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
VGLMouseStatus(int *x, int *y, char *buttons)
|
VGLMouseStatus(int *x, int *y, char *buttons)
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
#include "vgl.h"
|
#include "vgl.h"
|
||||||
|
|
||||||
|
static int VGLBlank;
|
||||||
|
static byte VGLBorderColor;
|
||||||
static byte VGLSavePaletteRed[256];
|
static byte VGLSavePaletteRed[256];
|
||||||
static byte VGLSavePaletteGreen[256];
|
static byte VGLSavePaletteGreen[256];
|
||||||
static byte VGLSavePaletteBlue[256];
|
static byte VGLSavePaletteBlue[256];
|
||||||
@ -636,6 +638,12 @@ VGLSetPaletteIndex(byte color, byte red, byte green, byte blue)
|
|||||||
outb(0x3C0, 0x20);
|
outb(0x3C0, 0x20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
VGLRestoreBorder(void)
|
||||||
|
{
|
||||||
|
VGLSetBorder(VGLBorderColor);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VGLSetBorder(byte color)
|
VGLSetBorder(byte color)
|
||||||
{
|
{
|
||||||
@ -646,10 +654,17 @@ VGLSetBorder(byte color)
|
|||||||
outb(0x3C0,0x11); outb(0x3C0, color);
|
outb(0x3C0,0x11); outb(0x3C0, color);
|
||||||
inb(0x3DA);
|
inb(0x3DA);
|
||||||
outb(0x3C0, 0x20);
|
outb(0x3C0, 0x20);
|
||||||
|
VGLBorderColor = color;
|
||||||
if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
|
if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
|
||||||
ioctl(0, KDDISABIO, 0);
|
ioctl(0, KDDISABIO, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
VGLRestoreBlank(void)
|
||||||
|
{
|
||||||
|
VGLBlankDisplay(VGLBlank);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VGLBlankDisplay(int blank)
|
VGLBlankDisplay(int blank)
|
||||||
{
|
{
|
||||||
@ -660,6 +675,7 @@ VGLBlankDisplay(int blank)
|
|||||||
VGLCheckSwitch();
|
VGLCheckSwitch();
|
||||||
outb(0x3C4, 0x01); val = inb(0x3C5); outb(0x3C4, 0x01);
|
outb(0x3C4, 0x01); val = inb(0x3C5); outb(0x3C4, 0x01);
|
||||||
outb(0x3C5, ((blank) ? (val |= 0x20) : (val &= 0xDF)));
|
outb(0x3C5, ((blank) ? (val |= 0x20) : (val &= 0xDF)));
|
||||||
|
VGLBlank = blank;
|
||||||
if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
|
if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
|
||||||
ioctl(0, KDDISABIO, 0);
|
ioctl(0, KDDISABIO, 0);
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,7 @@ void VGLMouseAction(int dummy);
|
|||||||
void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
|
void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
|
||||||
void VGLMouseSetStdImage(void);
|
void VGLMouseSetStdImage(void);
|
||||||
int VGLMouseInit(int mode);
|
int VGLMouseInit(int mode);
|
||||||
|
void VGLMouseRestore(void);
|
||||||
int VGLMouseStatus(int *x, int *y, char *buttons);
|
int VGLMouseStatus(int *x, int *y, char *buttons);
|
||||||
int VGLMouseFreeze(int x, int y, int width, int hight, u_long color);
|
int VGLMouseFreeze(int x, int y, int width, int hight, u_long color);
|
||||||
void VGLMouseUnFreeze(void);
|
void VGLMouseUnFreeze(void);
|
||||||
@ -142,6 +143,8 @@ void VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long colo
|
|||||||
void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
|
void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
|
||||||
void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
|
void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
|
||||||
void VGLClear(VGLBitmap *object, u_long color);
|
void VGLClear(VGLBitmap *object, u_long color);
|
||||||
|
void VGLRestoreBlank(void);
|
||||||
|
void VGLRestoreBorder(void);
|
||||||
void VGLRestorePalette(void);
|
void VGLRestorePalette(void);
|
||||||
void VGLSavePalette(void);
|
void VGLSavePalette(void);
|
||||||
void VGLSetPalette(byte *red, byte *green, byte *blue);
|
void VGLSetPalette(byte *red, byte *green, byte *blue);
|
||||||
|
Loading…
Reference in New Issue
Block a user