I would like to know how can I ask X11 which windows has focus. And if for any reason my own application (that may be visible or not) got the focus I want be able to let the former windows to get focus again.
For instance, my application is running with many others (e.g. firefox, gvim, nautilus,...)
Suppose that at first firefox has focus and that the user clicked on my app which now has the focus. I want that my application put focus on firefox again.
Does anyone knows how to achieve this? Books recommendations would be very nice.
Thanks a lot.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…