Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!stout.ucar.edu!corbet From: corbet@stout.ucar.edu (Jonathan Corbet) Newsgroups: comp.windows.x Subject: Awm infinite loop problem revisited Message-ID: <3512@ncar.ucar.edu> Date: 22 Jun 89 19:50:17 GMT Sender: news@ncar.ucar.edu Reply-To: corbet@stout.ucar.edu (Jonathan Corbet) Organization: Field Observing Facility, NCAR, Boulder, CO Lines: 46 A couple days ago I posted a question about an awm problem I have noticed, wherein awm will go into an infinite loop occasionally when f.iconify is invoked from a mouse button. I asked if anybody else had checked into it, but didn't get any affirmative responses, so I started digging, and I have an idea as to what is happening. The following line appears in my .awmrc file: f.iconify= m :window|icon: left down Awm implements this by doing a passive grab on the left button with the meta modifier on all top-level windows in the tree. When that button is pushed, the grab becomes active, and the event is delivered to awm as usual. Here comes the rub: awm then unmaps the window, and plunks an icon down somewhere else on the screen instead. This seems to terminate the grab, although I haven't seen anything in the book to say that this should happen. (I'm not saying it isn't there -- I just didn't see it). If you don't let up on the mouse button quickly enough, the ButtonRelease event is delivered to whatever window is under the cursor *now*, instead of the one which was iconified. If the event propagates back to the root window, awm seems to get it anyway, and everything is OK. If, however, the window under the pointer receives button events of its own (i.e. xterm, text widget, or xev), then that client gets the event, awm never sees it, and it busy waits until it gets a different button event from somewhere. So, the problem can now be easily reproduced: simply stack two xterms one on top of the other, iconify the top one with a button defined as above, and don't release the button until the iconified window is gone. Now I have a couple of different questions. (1) Is the passive grab mechanism really working the way I think it is, and is that the way it is supposed to work, and (2) any ideas for how to fix this problem? I am not sure why awm busy waits for the release event, but given that it does, my feeling is that awm should just do an active grab on the pointer to be sure that it gets that release event. Comments? (Details: Xsun 11.3, gcc) Thanks, Jonathan Corbet National Center for Atmospheric Research, Field Observing Facility corbet@stout.ucar.edu