Matthew D. Fuller wrote:
I'd suggest commenting out the Ungrab call and running with it. See what happens :)
I did that and immediately figured out why it was needed :-) I was going to make Alt+Mouse1 execute "xvkbd -text '\\m3v'", so that in Firefox Alt+Mouse1 would open the context menu and send a "v". Doing that while over a picture would then save this picture, thus simulating the old "Ctrl+Mouse1 = Save Picture" from Opera 11. Now with that Ungrab commented out, ctwm does never send the right mouse click to Firefox, instead it shows the little icon with the 3 mouse buttons with the right being filled. This is correct, of course, because the left mouse button is still hold and then xvkbd "executes" the right mouse button, and so ctwm shows the icon that it always shows when two mouse buttons are hold at the same time while being over the background. Thus, the XUngrabPointer in the f.exec allows the command that is executed by f.exec to simulate mouse clicks even if f.exec was started by a mouse click. This makes sense with my xvkbd example. So the bug is somewhere else: Looking at xev, the first click of the mouse button bound to the f.exec shows the ButtonRelease event, as it should. But it seems the mouse is still not fully released from ctwms POV. Because the next click shows the icon with the three mouse buttons where one is highlighed. That means ctwm still considers this mouse button pressed. BUT: only if the same button is pressed again. I.e., binding 'f.exec "true"' to the left mouse button and pressing it once (works) will cause no problem with all consecutive middle or right clicks. But with the next left click, no matter how long it takes until is is performed. But if ctwm really thought that the left mouse button was still hold, it would show the mouse icon also for the next middle or right click So it's just like ctwm spawns a separate state for the left mouse button that is only used when the left mouse button is pressed again but not for any other action. Really strange! -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
