From owner-svn-src-head@freebsd.org Sun Apr 9 06:47:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0505D357FC; Sun, 9 Apr 2017 06:47:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8C74A3D2; Sun, 9 Apr 2017 06:47:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id F24C042727A; Sun, 9 Apr 2017 16:46:54 +1000 (AEST) Date: Sun, 9 Apr 2017 16:46:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316642 - head/sys/dev/syscons In-Reply-To: <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> Message-ID: <20170409150512.B1318@besplex.bde.org> References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=2kjGuNizMhM4yULxnWoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 06:47:04 -0000 On Sun, 9 Apr 2017, Andrey Chernov wrote: > On 08.04.2017 13:00, Bruce Evans wrote: >> Log: >> Quick fix for removal of the mouse cursor in vga direct graphics modes >> (that is, in all supported 8, 15, 16 and 24-color modes). Moving the >> mouse cursor while holding down a button (giving cut marking) left a >> trail of garbage from misremoved mouse cursors (usually colored >> rectangles and not cursor shapes). Cases with a button not held down >> worked better and may even have worked. >> >> No renderer support for removing (software) mouse cursors is needed >> (and many renderers don't have any), since sc_remove_mouse_image() >> marks for update the region containing the image and usually much >> more. The mouse cursor can be (partially) over as many as 4 character >> cells, and removing it in only the 1-4 cells occupied by it would be >> best for efficiency and for avoiding flicker. > > Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes > SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for > the case they overlap valid characters region for some code tables. I didn't forget it, but these cells are only used in text mode and there are only 4 of them AFAIK (-M goes up to 252, which leaves space for only 4 cells 252-255). Text mode is is one case that has no renderer support for the mouse cursor. Later I found that some renderer support is needed in all graphics modes and would be needed in text mode too if it supported a reduced window (say 79x24) so that the mouse cursor works better. Normally the mouse course is reduced to 1 dot if it is at the right or bottom border, but in graphics modes there is sometimes extra space outside of the text window. E.g., in 800x600 mode, the default text window with an 8x16 font is 100x37 which occupies 800x592, so there is no extra space at the right border and 8 pixels at the bottom border. Users who wantt to see the full mouse cursor at the borders should configure a 99x36 or just an 80x25 text window. In text modes, there is no option to reduce the text window. So in graphics but not in text modes, the mouse cursor renderer must have special support for erasing the mouse outside of the text window, since other drawing methods top at the border. I don't understand SC_CURSOR_CHAR completely yet, but my cursor fixes so far are mainly to prepare for improving the keyboard cursor. SC_CURSOR_CHAR is normally statically configured as (0x07) SC_MOUSE_CHAR as (0xd0) (both with bogus parentheses). SC_CURSOR_CHAR is ifdefed but is not a supported option. SC_MOUSE_CHAR is a supported option. NOTES gives the example of setting it to 0x3. Then if the configured SC_CURSOR_CHAR is inside the 4-char range for the mouse cursor, then SC_CURSOR_CHAR is moved to (SC_MOUSE_CHAR + 4), although this is even more broken if the mouse range is 252-255 and the cursor char is in this range -- then the cursor char ends up as the invalid char 256. Reconfiguring the mouse char range using -M causes similar problems. There is no way to reconfigure the cursor char AFAIK. In fact, it doesn't even seem to be configured -- SC_CURSOR_CHAR is never used, so I think sc->cursor_char is only statically initialized to 0. This is a smaller bug with scteken. Teken breaks support for printing character 0 (which is normally blank in syscons' fonts), so this font position for this character is always available for use as the cursor character. I tested using the cursor char a little. I normally use a non-blinking normal keyboard cursor and see only negative advantages for the cursor character. But it would be useful to switch the cursor character(s) or attributes occasionally to highlight the cursor by blinking it once or twice, as is done using ripples for mouse cursors in some systems. Changing the charcter is more interesting than blinking, and needed more if there are only 2 colors. The "normal" keyboard cursor should be the character under the cursor with its bg modified to a unique color. This only happens in some cases now. Text mode usually works right, except the preferred unique color is hard-coded as white and when the fg or bg or the current char is also white, reverse video is used instead. Other modes mostly use reverse video. Reverse video is worse than usual when it is done more than once. Cur marking also gives reverse video. The sc cursor over cut marking is reversed again, making it look strange. The vt cursor over cut marking is not reversed again, making it invisible. The mouse cursor mostly works better by being destructive. Bruce