Window Information tool

This is a discussion on Window Information tool within the Xwindows forums, part of the Tools category; 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 ...

Go Back   Unix Linux Forum > Technologies & Tools > Tools > Xwindows

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-09-2008, 04:52 AM
Default Window Information tool

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/

Reply With Quote
  #2  
Old 10-31-2008, 03:26 AM
Default Re: Window Information tool

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/

Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 12:52 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger