Exiting Sunview - long

2007-12-25 7:33:00

 

Hi People,

Thanks to all who replied.

The original questions was :

>>"Is there a solution for the forgotten cursor after

>> exiting sunview and openwindows in color sparcs ?"

The first thing is that is a bug in the GX software.

In "Read This First" you'll find a short program listed that

fixes this program. Thanks to

 "John R. Kilheffer" <amp19263%garfield.amp.com@RELAY.CS.NET> and

 kevinmac@ll.mit.edu (Kevin McElearney)

this program is typed in the end of this message.

There is another short program that also fixes the problem. Thanks to

 "Mark J. McIntosh" <mmcintos@sirius.UVic.CA> this also is typed.

Both programs worked fine.

List of Honor:

 dan@breeze.bellcore.com (Daniel Strick)

 igor!ddull@uunet.UU.NET (David Dull)

 stevo@elroy.Jpl.Nasa.Gov (Steve Groom)

 mikulska@ece.UCSD.EDU (Margaret Mikulska)

 dasun!myers@sunkist.West.Sun.COM (Allen Myers (Myers) x6684)

 lamour@maestro.mitre.org (Michael Lamoureux)

 "Mark J. McIntosh" <mmcintos@sirius.UVic.CA>

 "John R. Kilheffer" <amp19263%garfield.amp.com@RELAY.CS.NET>

 kevinmac@ll.mit.edu (Kevin McElearney)

Diogenes C. Silva Jr.

dgns@dccbhz.ufmg.br

Computer Science Dept.

Federal University of Minas Gerais - Brasil

>>>> The "Read this First" Program. by SUN.

/*

* gxcursor -- disable GX cursor. Workaround to remove GX hardware cursor

* from screen after exiting OpenWindows. Taken from page 11

* of "READ THIS FIRST: OpenWindows Version 2"

*

* to compile: cc -O -o gxcursor gxcursor.c -lpixrect

*

*/

#include <stdio.h>

#include <sys/types.h>

#include <sys/ioctl.h>

#include <sun/fbio.h>

#include <pixrect/pixrect.h>

#include <pixrect/memvar.h>

struct cg6pr {

        struct mprp_data mprp; /* memory pixrect simulator */

        int fd; /* device file descriptor */

        struct pr_size cg6size; /* screen size */

        caddr_t cg6_fbc; /* FBC base */

        caddr_t cg6_tec; /* TEC base */

}

#define THCOFFSET (5 * 4096)

#define THC_CURSOR 0x8FC

main(argc,argv)

        int argc;

        char *argv[];

{

        char *dev = argc > 1 ? argv[1] : "/dev/fb";

        int fd;

        struct fbgattr fbattr;

        Pixrect *pr;

        if ((fd = open(dev, 2, 0)) < 0) {

                perror(dev);

                exit(1);

                }

        if (ioctl(fd, FBIOGATTR, &fbattr) < 0 ||

                fbattr.fbtype.fb_type != FBTYPE_SUNFAST_COLOR) {

                fprintf(stderr, "device %s is not a GX frame buffer\n", dev);

                exit(1);

                }

        (void) close(fd);

        if ((pr = pr_open(dev)) == 0) {

                fprintf(stderr, "pixrect open failed for %s\n", dev);

                exit(1);

                }

        * (int *) (((struct cg6pr *) pr->pr_data)->cg6_fbc +

                THCOFFSET + THC_CURSOR) = 0xffe0ffe0;

        exit(0);

}

============

>>>>>The shorter program.

============

/*

 * Mark McIntosh <mmcintos@sirius.UVic.CA> (604)721-6049

 * University of Victoria, Faculty of Engineering

 * Box 3055, Victoria BC V8W 3P6

 * CANADA

 *

 * HISTORY

 * 90Dec12 Mark McIntosh Pulled off net - see comments below

 * 91Jun21 Mark McIntosh Check return value of open on /dev/fb

 *

 */

/*

 * Comments from original news posting in comp.sys.sun for this program:

 *

 * We've just started upgrading to 4.1.1, and most things seem to work great.

 * However, the SunView mouse pointer (the arrow) doesn't go away when we

 * exit SunView. It stays on the screen until we enter SunView again. This

 * isn't too bad on the console, but it's very annoying when we start up MIT

 * X Windows (X11R4). We haven't tried OpenWindows 2.0 yet.

 *

 * I've experienced the same problem both with SunView and OpenWindows 2.0

 * immediately after installing the GFX patch from sun. It appears that both

 * of these programs take "advantage" of the hardware cursor support

 * avaliable with the GX board, but fail to turn the cursor off when they

 * exit. The following bit of code will turn the cursor off.

 *

 * Alfred A. Rizzi al@corwin.eng.yale.edu ph: (203) 432-4239

 * Yale Robotics Laboratory fx: (203) 432-7481

 * Department of Electrical Engineering, 1968 Yale Station, New Haven, CT 06520

 *

 */

#include <stdio.h>

#include <fcntl.h>

#include <sys/ioccom.h>

#include <sun/fbio.h>

main()

{

  int fd;

  struct fbcursor curs ;

  curs.set = FB_CUR_SETCUR;

  curs.enable = 0;

  if ( (fd = open("/dev/fb", O_RDWR)) < 0 ) {

     fprintf(stderr, "Can't open /dev/fb\n");

     exit(0);

  }

  ioctl(fd, FBIOSCURSOR, &curs);

  close(fd);

}

========

 

----- End Included Message -----

 

Comments

Got something to say?

You must be logged in to post a comment.