From owner-svn-src-head@freebsd.org Tue Sep 3 14:07:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA7A6DD762; Tue, 3 Sep 2019 14:07:15 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N80M0t8Tz4QPy; Tue, 3 Sep 2019 14:07:15 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 99ACF1B344; Tue, 3 Sep 2019 14:06:33 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8D4CB1B287; Sun, 21 Apr 2019 10:33:14 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE6216CEA5; Sun, 21 Apr 2019 10:33:13 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 13D021B22D; Sun, 21 Apr 2019 10:33:13 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C0CFB1B225 for ; Sun, 21 Apr 2019 10:33:10 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 762D46CE92; Sun, 21 Apr 2019 10:33:10 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BCEC24218; Sun, 21 Apr 2019 10:33:10 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3LAXAjL040281; Sun, 21 Apr 2019 10:33:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LAX9vF040274; Sun, 21 Apr 2019 10:33:09 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904211033.x3LAX9vF040274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346486 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: BE6216CEA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:07:37 -0000 X-Original-Date: Sun, 21 Apr 2019 10:33:09 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:07:37 -0000 Author: bde Date: Sun Apr 21 10:33:09 2019 New Revision: 346486 URL: https://svnweb.freebsd.org/changeset/base/346486 Log: Fix missing restoring of the mouse cursor position, the border color and the blank state after a screen switch. Modified: head/lib/libvgl/main.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/main.c Sun Apr 21 10:33:09 2019 (r346486) @@ -436,6 +436,9 @@ VGLCheckSwitch() VGLDisplay->Xsize = VGLModeInfo.vi_width; VGLDisplay->Ysize = VGLModeInfo.vi_height; VGLSetVScreenSize(VGLDisplay, VGLDisplay->VXsize, VGLDisplay->VYsize); + VGLRestoreBlank(); + VGLRestoreBorder(); + VGLMouseRestore(); VGLPanScreen(VGLDisplay, VGLDisplay->Xorigin, VGLDisplay->Yorigin); switch (VGLDisplay->Type) { case VIDBUF4S: Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/mouse.c Sun Apr 21 10:33:09 2019 (r346486) @@ -272,6 +272,22 @@ VGLMouseInit(int mode) 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 VGLMouseStatus(int *x, int *y, char *buttons) { Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/simple.c Sun Apr 21 10:33:09 2019 (r346486) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include "vgl.h" +static int VGLBlank; +static byte VGLBorderColor; static byte VGLSavePaletteRed[256]; static byte VGLSavePaletteGreen[256]; static byte VGLSavePaletteBlue[256]; @@ -637,6 +639,12 @@ VGLSetPaletteIndex(byte color, byte red, byte green, b } void +VGLRestoreBorder(void) +{ + VGLSetBorder(VGLBorderColor); +} + +void VGLSetBorder(byte color) { if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0)) @@ -646,11 +654,18 @@ VGLSetBorder(byte color) outb(0x3C0,0x11); outb(0x3C0, color); inb(0x3DA); outb(0x3C0, 0x20); + VGLBorderColor = color; if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT) ioctl(0, KDDISABIO, 0); } void +VGLRestoreBlank(void) +{ + VGLBlankDisplay(VGLBlank); +} + +void VGLBlankDisplay(int blank) { byte val; @@ -660,6 +675,7 @@ VGLBlankDisplay(int blank) VGLCheckSwitch(); outb(0x3C4, 0x01); val = inb(0x3C5); outb(0x3C4, 0x01); outb(0x3C5, ((blank) ? (val |= 0x20) : (val &= 0xDF))); + VGLBlank = blank; if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT) ioctl(0, KDDISABIO, 0); } Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/vgl.h Sun Apr 21 10:33:09 2019 (r346486) @@ -130,6 +130,7 @@ void VGLMouseAction(int dummy); void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask); void VGLMouseSetStdImage(void); int VGLMouseInit(int mode); +void VGLMouseRestore(void); int VGLMouseStatus(int *x, int *y, char *buttons); int VGLMouseFreeze(int x, int y, int width, int hight, u_long color); void VGLMouseUnFreeze(void); @@ -142,6 +143,8 @@ void VGLFilledBox(VGLBitmap *object, int x1, int y1, i 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 VGLClear(VGLBitmap *object, u_long color); +void VGLRestoreBlank(void); +void VGLRestoreBorder(void); void VGLRestorePalette(void); void VGLSavePalette(void); void VGLSetPalette(byte *red, byte *green, byte *blue);