jne@goldhill.COM (08/08/89)
I have a reasonably tricky application regarding keyboard focus and am not quite sure what to do. I am building a lisp interface to an X-based window system. In general, I want the window manager to set the focus to one of my windows (which I may pass to a different one on my windows using the WM_TAKE_FOCUS mechanism). This all works great using the ICCCM "Locally Active Input" model which allows me to set focus to any of my client's windows as long as my client already has the focus. Here's the problem. From my lisp listener, which is not one of my client's windows (it's the xterm from which I invoked lisp), I can enter: (SELECT *WINDOW-1*) which means that I want *WINDOW-1* to have the focus when the window manager wants any of my windows to have the focus. If I accomplish this by XSetInputFocus of the shell associated with *WINDOW-1*, I tend to get Bad Match errors. I assume this is because 1) the window isn't visible, or 2) none of my windows has the focus at the time of XSetInputFocus call, violating the "Locally Active Input" definition. Do I have to track FocusIn/FocusOut on all my windows to see if my client has the focus? Do I need visible_interest set for my shell's class to determine if it is ok to XSetInputFocus? Any help would be greatly appreciated. Jeff Eisen Gold Hill Computers
rws@EXPO.LCS.MIT.EDU (08/09/89)
If I accomplish this by XSetInputFocus of the shell associated with *WINDOW-1*, I tend to get Bad Match errors. I assume this is because 1) the window isn't visible This reason is consistent with the protocol specification.
jne@goldhill.COM (08/09/89)
>> If I accomplish this by XSetInputFocus of the shell associated >> with *WINDOW-1*, I tend to get Bad Match errors. I assume >> this is because 1) the window isn't visible > rws Responds: > This reason is consistent with the protocol specification. Does this mean I have to use visible_interest in my shell class (btw, why is visible_interest a class variable instead of a widget variable?) or is there some other way to determine if it's safe to do a XSetInputFocus? -Jeff