Keeping dialgs on top of parent window - Motif

This is a discussion on Keeping dialgs on top of parent window - Motif ; I have a Motif application (running under IceWM, if that makes a difference) which has many dialog boxes. However, I find that if I have a modal dialog box up, an accidental click on its parent will bring that parent ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Keeping dialgs on top of parent window

  1. Keeping dialgs on top of parent window

    I have a Motif application (running under IceWM, if that makes a
    difference) which has many dialog boxes. However, I find that if I
    have a modal dialog box up, an accidental click on its parent will
    bring that parent to the front, and the child gets lost behind.

    Is there any way I can force the child to stay on top of its parent?
    I've googled the web and Usenet for this, but have been unable to find
    an answer to my question (even if it's "Sorry, can't be done", it
    would be good to know).

    Many thanks.


  2. Re: Keeping dialgs on top of parent window


    "Dave Weaver" wrote in message
    news:453c74a6$0$18780$fa0fcedb@news.zen.co.uk...
    >I have a Motif application (running under IceWM, if that makes a
    > difference) which has many dialog boxes. However, I find that if I
    > have a modal dialog box up, an accidental click on its parent will
    > bring that parent to the front, and the child gets lost behind.
    >
    > Is there any way I can force the child to stay on top of its parent?
    > I've googled the web and Usenet for this, but have been unable to find
    > an answer to my question (even if it's "Sorry, can't be done", it
    > would be good to know).
    >
    > Many thanks.
    >


    There can be several things that may cause this:
    1. The shell parent of the dialog is a TopLevelShell instead of a
    DialogShell.
    2. The window manager may be allowing this. For example, in a dtwm
    window manager, setting "Allow Primary Windows On Top" can cause this.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project



  3. Re: Keeping dialgs on top of parent window

    In article <453c74a6$0$18780$fa0fcedb@news.zen.co.uk> zen13097@zen.co.uk writes:
    >I have a Motif application (running under IceWM, if that makes a
    >difference) which has many dialog boxes. However, I find that if I
    >have a modal dialog box up, an accidental click on its parent will
    >bring that parent to the front, and the child gets lost behind.
    >
    >Is there any way I can force the child to stay on top of its parent?
    >I've googled the web and Usenet for this, but have been unable to find
    >an answer to my question (even if it's "Sorry, can't be done", it
    >would be good to know).


    Because different window managers respond to different rules, there is no
    absolutely guaranteed way to do this. It is the window manager that controls
    which window is on top of which other window, and not all window managers
    pay attention to the same set of hints for "topness".

    The most reliable way is to run a timer that fires every once in a while
    (maybe every 200 to 500 ms) and does a raise on the modal dialog whenever
    it fires.

    -Pete Zakel
    (phz@seeheader.nospam)

    "Pascal is not a high-level language."

    -Steven Feiner

  4. Re: Keeping dialgs on top of parent window

    On 23 Oct 2006 07:52:06 GMT, Dave Weaver wrote:

    >I have a Motif application (running under IceWM, if that makes a
    >difference) which has many dialog boxes. However, I find that if I
    >have a modal dialog box up, an accidental click on its parent will
    >bring that parent to the front, and the child gets lost behind.
    >
    >Is there any way I can force the child to stay on top of its parent?
    >I've googled the web and Usenet for this, but have been unable to find
    >an answer to my question (even if it's "Sorry, can't be done", it
    >would be good to know).
    >
    >Many thanks.


    If the dialog box is modal, then *by definition* a click in its parent
    should be ignored (only exception: click on the minimize button in the
    WM frame of the parent). Hence, either your WM behavesincorrectly, or
    you create the dialogs incorrectly. Can you post a minimal program
    showing the behavoiur, so we can try it?

+ Reply to Thread