Subject: FVWM: XCircuit input focus (fwd)

From: Shaul Karl <[email-masked]>
Date: Fri, 29 Oct 1999 10:43:57 +0200

I think the following might be of interest to the fvwm group.
It concerns a difference between various wm that caused a bug in the xcircuit 
package.

------- Forwarded Message

Delivery-Date: Fri Oct 29 09:12:38 1999
Date: Tue, 26 Oct 1999 10:08:06 -0400
From: "R. Timothy Edwards" <[email-masked]>
To: [email-masked]
Subject: XCircuit input focus
Cc: [email-masked], [email-masked]
Status: O

Dear Ray,
   After bringing up WindowMaker and playing around with your
suggestions and one of my own, I finally came up with a "proper"
solution to the problem.  The correct solution is to have a
separate routine respond to EnterNotify events and change focus
there---I noticed the other day under fvwm (by the way, none of this
focus problem happens under the admittedly simpler twm window manager,
which is what I normally use), while I was using xcalc to figure out
scale values for an architectural drawing, that xcalc was doing
something like that:  whenever I entered the window, it immediately
had keyboard focus.  I didn't get the same effect in xcircuit until
I clicked in the window.  To do that, you need to add, around
xcircuit.c line 1694,

   XtAddEventHandler(top, EnterWindowMask, False,
        	(XtEventHandler)focusinput, NULL);

with a separate subroutine as follows:

/*----------------------------------------------------------------*/

void focusinput(w, clientdata, event)
  Widget w;
  caddr_t clientdata;
  XCrossingEvent *event;
{
   XSetInputFocus(dpy, XtWindow(w), RevertToPointerRoot, CurrentTime);
}

/*----------------------------------------------------------------*/

I ran this version under WindowMaker and the keyboard focus appears
to work right.  I also updated the minor version number and posted
the corrected code to the xcircuit web page.  Thanks for your help
in tracking down the problem.

						Regards,
						Tim

------- End of Forwarded Message

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].