From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM"  1-AUG-1993 11:42:43.61
To:	EVERHART
CC:	
Subj:	RE: xautolock problem on slower machines....

X-Newsgroups: comp.os.vms
Subject: RE: xautolock problem on slower machines....
Message-Id: <23bdp2$btk@lll-winken.llnl.gov>
From: oberman@ptavv.llnl.gov
Date: Fri, 30 Jul 93 15:12:51 GMT
Organization: Lawrence Livermore National Laboratory
Nntp-Posting-Host: ptavv.llnl.gov
Lines: 48
To: Info-VAX@kl.sri.com
X-Gateway-Source-Info: USENET

In Article <9307291801.AA04742@atc.boeing.com>
@atc.boeing.com:jem7049@61.464 (Joe Meadows (957-5690)) writes:
>I just got the xautolock program off of Hunter's fileserver, and am having a
>bit of a problem with it and thought I'd check to see if anyone else has
>encountered it and (better yet) fixed it!
>
>The problem is that it can bring up multiple decw$pausesession's (on a slow
>VS3100/40). It appears to be a timing problem, as though the code is checking to
>see if a pause screen is up shortly after starting to bring one up but before 
>the first one actually got its window mapped to the screen (i.e. it believes 
>there wasn't one brought up). I suppose the easiest fix would be to put in a 
>delay after it starts up a pause screen just to be sure to give it enough of a 
>chance to get up...
>
>'Course, it would be handy if DEC could put in the smarts to the Pause session
>program to not allow it to be active more than once per display but I can't
>admit to knowing the feasability of that (does X automatically kill properties
>set on a window by a given client if that client goes away?).
>
>A secondary side effect of this problem is that if I kill the extra pause 
>session(s) created (via STOP/ID), then xautolock hangs forever afterward.

Ooops! Looks like Hunter does not have the latest version. It was patched to
move the cursor to the center of the screen on activation, so no second
activation is possible. And there is logic to prevent a second pause session;
it just doesn't work right. :-(.

Here is the fix to be placed at line 1138 of xautolock.c.

/*      (Void) execl ("/bin/sh", "sh", "-c", locker, (String) NULL);*/
/*        Only fire up locker if not there--may have been done manually */
          if (!SmPauseWindow(d,r))
/* Send pointer to center of screen--so we don't get locked out again */
            {
               Screen*  s = ScreenOfDisplay (d, DefaultScreen (d));
               XWarpPointer (d, None, DefaultRootWindow (d), 0, 0, 0, 0,
                          WidthOfScreen (s) / 2, HeightOfScreen (s) / 2);
               (Void) execl (locker, (String) NULL);
            }
        (Void) _exit (PROBLEMS);

      default :

R. Kevin Oberman			Lawrence Livermore National Laboratory
Internet: koberman@llnl.gov		(510) 422-6955

Disclaimer: Being a know-it-all isn't easy. It's especially tough when you
don't know that much. But I'll keep trying. (Both)

