Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!pasteur!shambhala.Berkeley.EDU!ricks From: ricks@shambhala.Berkeley.EDU (Rick L Spickelmier) Newsgroups: comp.windows.x Subject: Re: bug in Xaw asciiStringWidget Keywords: Xaw asciiStringWidget keyboard actions loss Message-ID: <19590@pasteur.Berkeley.EDU> Date: 15 Nov 89 16:45:49 GMT References: <167@harley.nsc.com> <2566@goanna.oz.au> Sender: news@pasteur.Berkeley.EDU Reply-To: ricks@berkeley.edu Organization: UC Berkeley IC CAD Group Lines: 30 This is your window manager hosing you. I had the same problem with XRN. After a popup window is popped down, all keyboard input would be lost (typing in asciiStringWidgets, accelerators for buttons). Under some window managers the keyboard input would not be lost (uwm for example), but under most of the new generation window managers (gwm, twm) the keyboard input would go away..... The problem has to do with XSetInputFocus. When a popup is popped up, the window manager assigns it focus with: XtSetInputFocus(..., ..., ReverToPointerRoot, CurrentTime). When the popup is popped down, the focus is not reverted back to the previous state (i.e. before the popup appeared). It either goes to the root window or stays with the popup (I'm not sure of which one). The answers I got from those more knowledgable about such things is that your application has to have it's own event handlers for focus in/out and the application must then assign focus back to where you want it. However, since focus was not assigned to any particular widget in the application, but based on where the pointer was positioned, this seemed wrong... Anyway, I got around the problem by having XRN destroy the popup widget after popping it down. This caused the focus to end up in the state it was before the popup appeared. Rick Spickelmier UC Berkeley ricks@berkeley.edu