I'll try to make this short and to the point, but I can't promise anything. If someone on this list thinks this question shouldn't be on this list, let me know, and I'll drop it. Thanks.
The problem concerns my tweaking of a window manager (evilwm). Now, I don't want everyone to go off on a 'my window manager is better than yours' rant -- my question has to do the way X handles a key release. Now, the thing I'm trying to do is make the cycling through the windows re-order themselves after all the Alt+Tab's have done (kinda like Windows). The reason I want to do this, is that it's a major pain in the arse to cycle through all the windows to get to the one I want. Plus, if I want to flip through two in quick succession, I don't want to have to cycle through _all_ the rest to get to the one I want. Just a little background here, but as you may guess, the window list is in a linked-list format. Which means that the you go through the list whenever you go through the windows linked-list with Alt+Tab. Basically, what I want to do is re-order the list when the Alt and Tab are released.
Now, my problem is that X isn't notifying the program, evilwm, that the Alt key has been released. What I do is, at the first Tab KeyPress, I grab the Alt key with:
XGrabKey(dpy, XKeysymToKeycode(dpy, \
XK_Alt_L), AnyModifier, \
screens[0].root, False, \
GrabModeAsync, GrabModeAsync);Then at the Alt KeyRelease event, I ungrab the Alt key. Pretty easy, right? However, the Alt KeyRelease isn't always sent (sometimes it is, with particular combinations of Alt+Tab which I won't go into, but usually not). I've been able to work around part of the problem. Whenever another KeyPress comes in, I see if it's _not_ Tab and if the Alt has been grabbed, then I ungrab the Alt key, re-order the windows, and XTEST the key again. That seems to handle the major problem. However, that just leaves me with a thornier one. If the user wants to flip back and forth between windows, they'll come back with a Alt+Tab combo. This means the above work-around _doesn't_ work. The Alt won't be released, the windows won't be re-ordered, and the XTEST doesn't get sent. So my questions are:
1) Why doesn't X send the Alt KeyRelease? And how can I (without changing the X server) get it to? Is my GrabKey incorrect? Do I have to redo the key repeat setting for the Alt key? BTW, this non-KeyRelease sending on Alt release happens on Slack9.0 (X ver. 4.3.0) and OpenBSD 3.2 (X ver. 4.2.1), so I'd say it's not an OS-specific prob.
2) If someone knows a window manager which does window re-ordering on the X level (KDE and Gnome are too abstracted from X to help me) after window switching, I'd like to know it. I've take a look at weewm, aewm, and many others besides, so if you've got any suggestions, I'd be glad to hear'em.
BTW, if there's anything that'll help you help me figure this out, I'll be glad to get it to you.
Thanks.
David
_______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
