How can I detecting window visibility - Xwindows

This is a discussion on How can I detecting window visibility - Xwindows ; One way of doing this in X11 is to handle VisibilityNotify events for the window. But One problem is when the window's parent was unmapped by the window's parent's parent, only the window's parent received UnMapNotify. The window will not ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How can I detecting window visibility

  1. How can I detecting window visibility

    One way of doing this in X11 is to handle VisibilityNotify events for
    the window. But One problem is when the window's parent was unmapped
    by the window's parent's parent, only the window's parent received
    UnMapNotify. The window will not know if the parent has been unmapped.
    So that I can not know if the window is realy visible. For example, If
    I move to another desktop, I will not know the visibility of the
    window. Of course I can query the attribute of parent window, I can
    get this infomation. But if the window tree is large, then such a
    query will cost a lot of resources. Is there any way to detect the
    window's real visibility.

    I know in window you can simple use "if(GetClipBox( dc, &cr ) !=
    NULLREGION)" to detect the visibility.

    Thanks a lot.

  2. Re: How can I detecting window visibility

    Hi Leon!

    On 06 Feb 04 at 09:24, "Leon" (Leon ) wrote:
    Leon> One way of doing this in X11 is to handle VisibilityNotify events
    Leon> for the window. But One problem is when the window's parent was
    Leon> unmapped by the window's parent's parent, only the window's parent
    Leon> received UnMapNotify. The window will not know if the parent has
    Leon> been unmapped. So that I can not know if the window is realy
    Leon> visible. For example, If I move to another desktop, I will not know
    Leon> the visibility of the window. Of course I can query the attribute of
    Leon> parent window, I can get this infomation. But if the window tree is
    Leon> large, then such a query will cost a lot of resources. Is there any
    Leon> way to detect the window's real visibility.

    Try XGetWindowAttributes and its XWindowAttributes.map_state field .

    --
    Sincerely,
    Dmitry

    --- www.karasik.eu.org ---

    He who dies with most the toys wins

  3. Re: How can I detecting window visibility

    Dmitry Karasik wrote in message news:<84broc8jbu.fsf@raven.plab.ku.dk>...
    > Hi Leon!
    >
    > On 06 Feb 04 at 09:24, "Leon" (Leon ) wrote:
    > Leon> One way of doing this in X11 is to handle VisibilityNotify events
    > Leon> for the window. But One problem is when the window's parent was
    > Leon> unmapped by the window's parent's parent, only the window's parent
    > Leon> received UnMapNotify. The window will not know if the parent has
    > Leon> been unmapped. So that I can not know if the window is realy
    > Leon> visible. For example, If I move to another desktop, I will not know
    > Leon> the visibility of the window. Of course I can query the attribute of
    > Leon> parent window, I can get this infomation. But if the window tree is
    > Leon> large, then such a query will cost a lot of resources. Is there any
    > Leon> way to detect the window's real visibility.
    >
    > Try XGetWindowAttributes and its XWindowAttributes.map_state field .


    I have tried it.
    In fact the XWindowAttributes.map_state field of child window can not
    tell the status of parent window. I can query every parent windows'
    attributes. But it cost too much resources. I'd like to get informed
    by parent window that the parent window has been umapped.

  4. Re: How can I detecting window visibility

    Hi Leon!

    On 11 Feb 04 at 10:03, "Leon" (Leon ) wrote:

    >> Try XGetWindowAttributes and its XWindowAttributes.map_state field .

    Leon> I have tried it. In fact the XWindowAttributes.map_state field of
    Leon> child window can not tell the status of parent window. I can query
    Leon> every parent windows' attributes. But it cost too much
    Leon> resources. I'd like to get informed by parent window that the parent
    Leon> window has been umapped.

    As the man page says,

    The map_state
    member is set to indicate the state of the window and can be IsUn-
    mapped, IsUnviewable, or IsViewable. IsUnviewable is used if the win-
    dow is mapped but some ancestor is unmapped.

    --
    Sincerely,
    Dmitry

    --- www.karasik.eu.org ---

    The woods are full of people who want your job -- Dilbert

+ Reply to Thread