How to get properties of existing windows? - Motif

This is a discussion on How to get properties of existing windows? - Motif ; I would like to query the properties of existing windows, i.e. those that were not created by me. In particular, I would like to know their dimensions and their titles (or some other means of identifying them). It seems like ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: How to get properties of existing windows?

  1. How to get properties of existing windows?

    I would like to query the properties of existing windows, i.e. those
    that were not created by me. In particular, I would like to know
    their dimensions and their titles (or some other means of identifying
    them). It seems like this should be straightforward, but I haven't
    been able to figure it out. Any help is much appreciated!


  2. Re: How to get properties of existing windows?

    Ishmael wrote:
    > I would like to query the properties of existing windows, i.e. those
    > that were not created by me. In particular, I would like to know
    > their dimensions and their titles (or some other means of identifying
    > them). It seems like this should be straightforward, but I haven't
    > been able to figure it out. Any help is much appreciated!
    >


    Look at the source for xwininfo utility (a Google search should bring
    hits that include the source code).

    Jim Lahue

  3. Re: How to get properties of existing windows?


    "Ishmael" wrote in message
    news:1172085082.715578.113410@v45g2000cwv.googlegr oups.com...
    >I would like to query the properties of existing windows, i.e. those
    > that were not created by me. In particular, I would like to know
    > their dimensions and their titles (or some other means of identifying
    > them). It seems like this should be straightforward, but I haven't
    > been able to figure it out. Any help is much appreciated!
    >

    In general, this cannot be done.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Aero Stability and Controls Computing



  4. Re: How to get properties of existing windows?

    Thank you both for responding.

    The 'xwininfo' function seems very promising, but unfortunately it
    does not report the actual edges of the window (it excludes the
    borders and the title bar, which is precisely the information I would
    like to include).

    As to the impossibility of doing this at all, I very much doubt that
    is the case. After all, the operating system has to know where to
    draw the window. Alas, extracting this information from Motif, X,
    draphics drivers, etc. has eluded me so far.

    Please let me know if you have any other ideas.



  5. Re: How to get properties of existing windows?


    "Ishmael" wrote in message
    news:1172116992.401075.85860@v45g2000cwv.googlegro ups.com...
    > Thank you both for responding.
    >
    > The 'xwininfo' function seems very promising, but unfortunately it
    > does not report the actual edges of the window (it excludes the
    > borders and the title bar, which is precisely the information I would
    > like to include).
    >
    > As to the impossibility of doing this at all, I very much doubt that
    > is the case. After all, the operating system has to know where to
    > draw the window. Alas, extracting this information from Motif, X,
    > draphics drivers, etc. has eluded me so far.
    >
    > Please let me know if you have any other ideas.
    >
    >

    You can always try things like XGetClassHint(), XGetSizeHints(),
    XGetWindowAttributes(), XGetWindowProperty(),
    XGetWMIconName(), XGetWMName(), XGetWMNormalHints()
    and XGetWMSizeHints().

    But be aware that these may return information that is not accurate -
    from the method names you can see that they are only hints about
    what the window would LIKE to be. Whether the window
    manager honored those hints is another question entirely.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Aero Stability and Controls Computing



  6. Re: How to get properties of existing windows?

    Ishmael wrote:
    > Thank you both for responding.
    >
    > The 'xwininfo' function seems very promising, but unfortunately it
    > does not report the actual edges of the window (it excludes the
    > borders and the title bar, which is precisely the information I would
    > like to include).
    >
    > As to the impossibility of doing this at all, I very much doubt that
    > is the case. After all, the operating system has to know where to
    > draw the window. Alas, extracting this information from Motif, X,
    > draphics drivers, etc. has eluded me so far.
    >
    > Please let me know if you have any other ideas.
    >
    >


    The problem is that the borders and title bar of the window aren't
    actually part of the window: they are small windows created by the
    window manager that give you the illusion that they are part of the main
    window. You need to find window manager properties that will give you
    the info that you are looking for. And, you have to hope that all
    window managers will return this information back to you.

    Jim Lahue

  7. Re: How to get properties of existing windows?


    > The problem is that the borders and title bar of the window aren't
    > actually part of the window: they are small windows created by the
    > window manager that give you the illusion that they are part of the main
    > window. You need to find window manager properties that will give you
    > the info that you are looking for. And, you have to hope that all
    > window managers will return this information back to you.
    >
    > Jim Lahue


    Ah, that's interesting. Do you by chance know how I query window
    manager properties? All the information I've been able to find refers
    to setting properties (via .Xdefaults, for example), not retrieving
    them. My window manager is dtwm (CDE/Solaris). Thanks again for you
    help.


  8. Re: How to get properties of existing windows?

    Ishmael wrote:
    >
    > Ah, that's interesting. Do you by chance know how I query window
    > manager properties? All the information I've been able to find refers
    > to setting properties (via .Xdefaults, for example), not retrieving
    > them. My window manager is dtwm (CDE/Solaris). Thanks again for you
    > help.
    >


    I have always been interested in what is inside my window area so I have
    never tried to find this information. Searching on Google didn't show
    me anything that would tell me how to determine the size of a border
    area set up by a window manager nor what the origin of a window would be
    when the border areas and title bar is included.

    Jim Lahue

+ Reply to Thread