This question is similar to this one
Fastest method of screen capturing
but for linux/X11.
To be more specific, i need a method to capture the pixel
This is just a wild guess, but I presume you could use x11vnc with the -id [windowid] (http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id) option to stream that single window over VNC. This will show you the whole window, with the exact same positioning as in the main screen (you might lose some popup menus), even when it is covered. You can fetch the window coordinates from the true X11 screen.
This is not possible with pure X11.
You can get what you want with compositing, but only on servers which support it (most modern ones do). This actually has nothing to do with window managers. A WM is just another client, albeit with some special abilities, but those are unrelated to compositing. You can use the same compositing API.
man xcomposite
should get you started.