| Unix Content | Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Hi, Under Windows, I often use a program called MWSnap for screenshots. One very handy feature it has is "window information". It shows a small dialog display the information under the mouse cursor. The other really neat part is that it draws a rectangle over the desktop highlighting the window it is showing information about. See the image below. The program automatically drew the rectangle where the mouse is located highlighting the window in question. As you move the mouse, so the rectangle is redraw. http://opensoft.homeip.net/~graemeg/...screenshot.png Is something like this possible in X-Window? It's would be similar to 'xwininfo' (command line app), but with runtime updates. I did find a GTK2 version of 'xwininfo' which seems to do what I want, but it doesn't draw the all important rectangle highlighting the window in question. If nobody knows of a tool like this, I would like to write one, but I don't know quite how? First off, how do you draw over all other windows? MWSnap seems to take a snapshot of the desktop before it draws the rectangle - because application windows are not updated will MWSnap is in "window info" mode. Anybody got some clues how all this can be done in X-Window? Regards, - Graeme - __________________________________________________ _____ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ |
|
#2
|
| Graeme Geldenhuys wrote: > > http://opensoft.homeip.net/~graemeg/...screenshot.png > > Is something like this possible in X-Window? It's would be similar to > 'xwininfo' (command line app), but with runtime updates. I did find a > GTK2 version of 'xwininfo' which seems to do what I want, but it doesn't > draw the all important rectangle highlighting the window in question. Just as a follow up. I have managed to implement this under X11 and it was much easier than I expected. Thanks to hordes of available open-source out there. :-) I simply grab the mouse pointer and poll it's position every xxx milliseconds. I then use a recursive XQueryPointer() call to track down the exact (top most) window under the cursor. Query the information about that window, translate the coordinates and use the "rubber band" technique to draw directly on the root (desktop) window highlighting the window in question. Next step will be to extend the information I display about the window. Name, classname, events it listens to etc... But I find the highlighting rectangle very useful - especially since I am a GUI toolkit developer. Regards, - Graeme - __________________________________________________ _____ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ |