[MPlayer-dev-eng] [PATCH] hide cursor on terminal

D Richard Felker III dalias at aerifal.cx
Sat Oct 12 04:26:15 CEST 2002


Hey. I would just commit this directly, but I'm not too familiar with
getch2.c so I'd like to run it by everyone first. This patch hides the
cursor when getch2 is enabled, which is needed when using the bes on
some cards, since the annoying flashing cursor appears over top of the
overlay. The old TOOLS/mpconsole script I wrote works around this, but
since it's mostly obsolete already I'd like to go ahead and make it
entirely obsolete. If no one objects I'll commit this patch soon.

Rich

-------------- next part --------------
Index: linux/getch2.c
===================================================================
RCS file: /cvsroot/mplayer/main/linux/getch2.c,v
retrieving revision 1.14
diff -u -r1.14 getch2.c
--- linux/getch2.c	3 May 2002 19:01:46 -0000	1.14
+++ linux/getch2.c	12 Oct 2002 02:43:57 -0000
@@ -215,6 +215,7 @@
 static int getch2_status=0;
 
 void getch2_enable(){
+    char *p;
 #ifdef HAVE_TERMIOS
 struct termios tio_new;
 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__)
@@ -236,10 +237,13 @@
     ioctl(0,TCSETS,&tio_new);
 #endif
 #endif
+    p=tgetstr("vi",&term_p);
+    if(p) write(1,p,strlen(p));
     getch2_status=1;
 }
 
 void getch2_disable(){
+    char *p;
     if(!getch2_status) return; // already disabled / never enabled
 #ifdef HAVE_TERMIOS
 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__)
@@ -250,6 +254,8 @@
     ioctl(0,TCSETS,&tio_orig);
 #endif
 #endif
+    p=tgetstr("ve",&term_p);
+    if(p) write(1,p,strlen(p));
     getch2_status=0;
 }
 


More information about the MPlayer-dev-eng mailing list