Re: syscons: incorrect behavior of blinking cursor

2000-02-10 Thread Ruslan Ermilov

On Thu, Feb 10, 2000 at 11:11:53AM +0900, Kazutaka YOKOTA wrote:
 On Wed, Feb 09, 2000 at 08:35:07PM +0200, Ruslan Ermilov wrote:
  Hi!
  
  1. Set cursor "blinking" or "destructive" (SC_BLINK_CURSOR)
  2. Press Scroll Lock (cursor will go away)
  3. Switch to another vtyX
  4. Switch to the original vty, where you pressed Scroll Lock
  5. Watch the cursor will appear at the same position as it was on vtyX.
  
 The following patch fixes the problem.
 
 Thank you for the report and patch.  
 
 While your patch seems to work, it looks to me it's slightly over-kill
 for this problem; we shouldn't need to call sc_remove_cursor_image()
 every time the screen is refreshed in scrn_upcate().
 
 Because this problem is caused by exchange_scr() not removing the text
 cursor when changing to the vty where the cursor is not currently
 shown, we had better fix exchange_scr().
 
 The attached patch is simpler and fixes the problem.  I verified it
 works here.  Please test.  Thank you.
 
Tested, it works, but while I was testing, I've found yet another glitch.

Please try an attached cursor.sh with and without an attached patch (p).
On my box, the cursor.sh causes "normal" cursor to be displayed several
times, and an attached patch fixes the problem.


Thanks,
-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

 cursor.sh

--- scterm-sc.c~Wed Feb  9 17:37:58 2000
+++ scterm-sc.c Thu Feb 10 10:22:58 2000
@@ -530,7 +530,6 @@
if (!ISGRAPHSC(sc-cur_scp)) {
i = spltty();
sc_set_cursor_image(sc-cur_scp);
-   sc_draw_cursor_image(sc-cur_scp);
splx(i);
}
break;
--- syscons.c~  Sun Feb  6 17:28:00 2000
+++ syscons.c   Thu Feb 10 10:26:41 2000
@@ -735,7 +735,6 @@
if (!ISGRAPHSC(sc-cur_scp)) {
s = spltty();
sc_set_cursor_image(sc-cur_scp);
-   sc_draw_cursor_image(sc-cur_scp);
splx(s);
}
return 0;
@@ -2335,6 +2334,8 @@
 
 /* save the current state of video and keyboard */
 sc_move_cursor(sc-old_scp, sc-old_scp-xpos, sc-old_scp-ypos);
+if (!ISGRAPHSC(sc-old_scp))
+   sc_remove_cursor_image(sc-old_scp);
 if (sc-old_scp-kbd_mode == K_XLATE)
save_kbd_state(sc-old_scp);
 



Re: syscons: incorrect behavior of blinking cursor

2000-02-09 Thread Ruslan Ermilov

On Wed, Feb 09, 2000 at 08:35:07PM +0200, Ruslan Ermilov wrote:
 Hi!
 
 1. Set cursor "blinking" or "destructive" (SC_BLINK_CURSOR)
 2. Press Scroll Lock (cursor will go away)
 3. Switch to another vtyX
 4. Switch to the original vty, where you pressed Scroll Lock
 5. Watch the cursor will appear at the same position as it was on vtyX.
 
The following patch fixes the problem.

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: scvgarndr.c
===
RCS file: /usr/FreeBSD-CVS/src/sys/dev/syscons/scvgarndr.c,v
retrieving revision 1.5
diff -u -p -r1.5 scvgarndr.c
--- scvgarndr.c 2000/01/29 15:08:47 1.5
+++ scvgarndr.c 2000/02/09 23:52:53
@@ -225,10 +225,8 @@ vga_txtcursor(scr_stat *scp, int at, int
   at%scp-xsize,
   at/scp-xsize); 
} else {
-   if (scp-status  VR_CURSOR_ON)
-   (*vidsw[adp-va_index]-set_hw_cursor)(adp,
-  -1, -1);
scp-status = ~VR_CURSOR_ON;
+   (*vidsw[adp-va_index]-set_hw_cursor)(adp, -1, -1);
}
} else {
scp-status = ~VR_CURSOR_BLINK;
Index: syscons.c
===
RCS file: /usr/FreeBSD-CVS/src/sys/dev/syscons/syscons.c,v
retrieving revision 1.335
diff -u -p -r1.335 syscons.c
--- syscons.c   2000/01/29 15:08:49 1.335
+++ syscons.c   2000/02/09 23:52:53
@@ -1806,7 +1806,8 @@ scrn_update(scr_stat *scp, int show_curs
scp-cursor_pos));
 }
 }
-}
+} else
+   sc_remove_cursor_image(scp);
 
 #ifndef SC_NO_CUTPASTE
 /* update "pseudo" mouse pointer image */



Re: syscons: incorrect behavior of blinking cursor

2000-02-09 Thread Kazutaka YOKOTA

On Wed, Feb 09, 2000 at 08:35:07PM +0200, Ruslan Ermilov wrote:
 Hi!
 
 1. Set cursor "blinking" or "destructive" (SC_BLINK_CURSOR)
 2. Press Scroll Lock (cursor will go away)
 3. Switch to another vtyX
 4. Switch to the original vty, where you pressed Scroll Lock
 5. Watch the cursor will appear at the same position as it was on vtyX.
 
The following patch fixes the problem.

Thank you for the report and patch.  

While your patch seems to work, it looks to me it's slightly over-kill
for this problem; we shouldn't need to call sc_remove_cursor_image()
every time the screen is refreshed in scrn_upcate().

Because this problem is caused by exchange_scr() not removing the text
cursor when changing to the vty where the cursor is not currently
shown, we had better fix exchange_scr().

The attached patch is simpler and fixes the problem.  I verified it
works here.  Please test.  Thank you.

Kazu

Index: syscons.c
===
RCS file: /src/CVS/src/sys/dev/syscons/syscons.c,v
retrieving revision 1.335
diff -u -r1.335 syscons.c
--- syscons.c   2000/01/29 15:08:49 1.335
+++ syscons.c   2000/02/10 01:52:28
@@ -2335,6 +2337,8 @@
 
 /* save the current state of video and keyboard */
 sc_move_cursor(sc-old_scp, sc-old_scp-xpos, sc-old_scp-ypos);
+if (!ISGRAPHSC(sc-old_scp))
+   sc_remove_cursor_image(sc-old_scp);
 if (sc-old_scp-kbd_mode == K_XLATE)
save_kbd_state(sc-old_scp);
 



Index: scvgarndr.c
===
RCS file: /usr/FreeBSD-CVS/src/sys/dev/syscons/scvgarndr.c,v
retrieving revision 1.5
diff -u -p -r1.5 scvgarndr.c
--- scvgarndr.c2000/01/29 15:08:47 1.5
+++ scvgarndr.c2000/02/09 23:52:53
@@ -225,10 +225,8 @@ vga_txtcursor(scr_stat *scp, int at, int
  at%scp-xsize,
  at/scp-xsize); 
   } else {
-  if (scp-status  VR_CURSOR_ON)
-  (*vidsw[adp-va_index]-set_hw_cursor)(adp,
- -1, -1);
   scp-status = ~VR_CURSOR_ON;
+  (*vidsw[adp-va_index]-set_hw_cursor)(adp, -1, -1);
   }
   } else {
   scp-status = ~VR_CURSOR_BLINK;
Index: syscons.c
===
RCS file: /usr/FreeBSD-CVS/src/sys/dev/syscons/syscons.c,v
retrieving revision 1.335
diff -u -p -r1.335 syscons.c
--- syscons.c  2000/01/29 15:08:49 1.335
+++ syscons.c  2000/02/09 23:52:53
@@ -1806,7 +1806,8 @@ scrn_update(scr_stat *scp, int show_curs
   scp-cursor_pos));
 }
 }
-}
+} else
+  sc_remove_cursor_image(scp);
 
 #ifndef SC_NO_CUTPASTE
 /* update "pseudo" mouse pointer image */


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message