xwd: how to capture window contents only - Xwindows

This is a discussion on xwd: how to capture window contents only - Xwindows ; Is there any way to dump the contents of a window without getting fragments of obstructing other windows (short of running xwd in a tiny window in the corner). I am surprised that xwd, without the -screen option, still dumps ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: xwd: how to capture window contents only

  1. xwd: how to capture window contents only

    Is there any way to dump the contents of a window without getting
    fragments of obstructing other windows (short of running xwd in
    a tiny window in the corner).

    I am surprised that xwd, without the -screen option, still dumps
    covering windows, instead of giving me the uncovered window
    contents.

    As I read the -screen option, it would seem xwd behaves as if the
    default is with -screen selected. The idea of showing the covering
    window fragments as they really are sounds like a great idea that
    you might need once-in-awhile, but normally you'd want to see the
    window unobstructed.


  2. Re: xwd: how to capture window contents only


    unix_fan wrote:
    > Is there any way to dump the contents of a window without getting
    > fragments of obstructing other windows (short of running xwd in
    > a tiny window in the corner).
    >
    > I am surprised that xwd, without the -screen option, still dumps
    > covering windows, instead of giving me the uncovered window
    > contents.
    >
    > As I read the -screen option, it would seem xwd behaves as if the
    > default is with -screen selected. The idea of showing the covering
    > window fragments as they really are sounds like a great idea that
    > you might need once-in-awhile, but normally you'd want to see the
    > window unobstructed.


    You may want to download a free copy of xv by John Bradley. It has
    many, many X window dumping options. It's a terrific tool and I use it
    all the time to produce documents describing my GUIs.


  3. Re: xwd: how to capture window contents only

    unix_fan wrote:
    > Is there any way to dump the contents of a window without getting
    > fragments of obstructing other windows (short of running xwd in
    > a tiny window in the corner).
    >
    > I am surprised that xwd, without the -screen option, still dumps
    > covering windows, instead of giving me the uncovered window
    > contents.
    >
    > As I read the -screen option, it would seem xwd behaves as if the
    > default is with -screen selected. The idea of showing the covering
    > window fragments as they really are sounds like a great idea that
    > you might need once-in-awhile, but normally you'd want to see the
    > window unobstructed.
    >


    That may be impossible for many graphics adapters. Your question
    assumes that the complete window data actually exists somewhere for xwd
    to get.

    A window usually maps into a specific spot in the framebuffer memory. A
    window that covers another window owns that spot in the framebuffer
    (assuming a unified framebuffer). When you read data from the covered
    window, then there isn't any data from the covered window in that
    position in the framebuffer to get, so when the data from the covered
    window is read, you end up with the data from the covering window or
    else junk (depending on how the clipping may work). This is also why an
    expose event is generated when the covering window is moved off the
    covered window -- to let an app know that part of the covered window
    needs to be redrawn.

    Jim Lahue

  4. Re: xwd: how to capture window contents only

    On Thu, 30 Nov 2006 08:05:37 -0600, Jim Lahue wrote:

    > unix_fan wrote:
    >> Is there any way to dump the contents of a window without getting
    >> fragments of obstructing other windows (short of running xwd in
    >> a tiny window in the corner).
    >>
    >> I am surprised that xwd, without the -screen option, still dumps
    >> covering windows, instead of giving me the uncovered window
    >> contents.
    >>
    >> As I read the -screen option, it would seem xwd behaves as if the
    >> default is with -screen selected. The idea of showing the covering
    >> window fragments as they really are sounds like a great idea that
    >> you might need once-in-awhile, but normally you'd want to see the
    >> window unobstructed.
    >>

    >
    > That may be impossible for many graphics adapters. Your question
    > assumes that the complete window data actually exists somewhere for xwd
    > to get.
    >
    > A window usually maps into a specific spot in the framebuffer memory. A
    > window that covers another window owns that spot in the framebuffer
    > (assuming a unified framebuffer). When you read data from the covered
    > window, then there isn't any data from the covered window in that
    > position in the framebuffer to get, so when the data from the covered
    > window is read, you end up with the data from the covering window or
    > else junk (depending on how the clipping may work). This is also why an
    > expose event is generated when the covering window is moved off the
    > covered window -- to let an app know that part of the covered window
    > needs to be redrawn.
    >
    > Jim Lahue



    I was afraid it would be something like that. Thank you for the
    clear and detailed explanation.


  5. Re: xwd: how to capture window contents only

    On Fri, 01 Dec 2006 09:06:16 +0100, unix_fan wrote:

    >On Thu, 30 Nov 2006 08:05:37 -0600, Jim Lahue wrote:
    >
    >> unix_fan wrote:
    >>> Is there any way to dump the contents of a window without getting
    >>> fragments of obstructing other windows (short of running xwd in
    >>> a tiny window in the corner).
    >>>

    >> That may be impossible for many graphics adapters. Your question
    >> assumes that the complete window data actually exists somewhere for xwd
    >> to get.
    >>
    >> A window usually maps into a specific spot in the framebuffer memory. A
    >> window that covers another window owns that spot in the framebuffer
    >> (assuming a unified framebuffer). When you read data from the covered
    >> window, then there isn't any data from the covered window in that
    >> position in the framebuffer to get, so when the data from the covered
    >> window is read, you end up with the data from the covering window or
    >> else junk (depending on how the clipping may work). This is also why an
    >> expose event is generated when the covering window is moved off the
    >> covered window -- to let an app know that part of the covered window
    >> needs to be redrawn.
    >>
    >> Jim Lahue

    >
    >
    >I was afraid it would be something like that. Thank you for the
    >clear and detailed explanation.


    With which I agree, with one small addition:, you increase your
    chances (but still no guarantees) of getting the 'private' contents of
    the window if the backbuffer and saveunder options are activated for
    the display.


+ Reply to Thread