[Lazarus] How to mimic MWSnap's "Window Information" feature on X11

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Oct 24 09:08:07 CEST 2008


On Fri, Oct 24, 2008 at 3:26 AM, Felipe Monteiro de Carvalho
> Lazarus supports screenshot taking, so this part is easy. If you are
> using pure X11 then take a look at the gtk2 implementation for
> screenshots, it uses x11.

Thanks Felipe, I'll take a look at that code.


> Next you take the mouse position and give to a X11 routine to get the
> window. I don't know which routine to use, but surely there is one,
> and further using X11 you can get the size of the window.

I think the 'wininfo' application will help me with this part.


> anything else. This is how the Virtual Magnifying Glass works (I draw
> a glass instead of rectangles and texts)

I'll download a copy of Virtual Magnifying Glass (VMG) to get a better
understanding of how it works. Maybe I can adapt VMG to draw
rectangles in it's window when the magnification is set to 1x. VMG
might save me a lot of work. :-)

> You can also do that with hardware overlays (so you don't need a
> screenshot, and the background is still alive), but it's a real
> painful thing to implement, requiring special hardware and offering
> tons of headackes, so I recomend in screenshot method =)

Many Window Managers in X11 has the option to disable full window move
or resize. Instead in only draws the window rectangle when you resize
or move. And when you leave the mouse button, then only does it redraw
the actual window.  I thought I could use the same idea as that. And
it doesn't seem to take a screenshot of the desktop, because the
background applications are still updating while busy with a window
resize. I guess they don't use hardware overlays, because it works on
all hardware. I guess I will have to search through some window
manager code to see how they accomplished that. Now where do I
start!!??  ;-)


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the Lazarus mailing list