Path: utzoo!attcan!uunet!ogicse!mintaka!bloom-beacon!eng.sun.COM!smarks From: smarks@eng.sun.COM (Stuart Marks, Four More Years!) Newsgroups: comp.windows.x Subject: Re: Why doesn't the WM_TAKE_FOCUS time work for XSetInputFocus? Message-ID: <9010051829.AA08202@trantor.Eng.Sun.COM> Date: 5 Oct 90 18:29:01 GMT References: <1990Oct2.215922.4553@vlsisj.uucp> Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 30 | The ICCCM document states that "Clients must not use CurrentTime | in the ``time'' field." when using XSetInputFocus. So I made | my code use the time from the WM TAKE FOCUS message, but this | doesn't work at all with mwm or olwm (it does work sometimes with | twm). This is odd. I can see no reason that it wouldn't work, and in fact it does work when done properly. The bit about "sometimes" working under twm makes me suspicious, because twm has a bug where it \always/ uses CurrentTime to set the focus. | I changed my code to use CurrentTime instead and it now | seems to work fine. Does anyone know why this is happening? | Will I have other problems from using CurrentTime? Yes, you will. Please don't use CurrentTime. What ICCCM focus model are you using? If you want to use the Globally Active model (like XView) you must ask for WM_TAKE_FOCUS and also set WM_HINTS.input to False. If you have WM_HINTS.input set to True, the window manager will set the focus to your top-level window automatically. If you also call XSetInputFocus in this case, you may be getting into a "fight" with the window manager over the focus. s'marks Stuart W. Marks ARPA: smarks@eng.sun.com Windows & Graphics Software UUCP: sun!smarks Sun Microsystems, Inc.