< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java

Print this page




1603 
1604                 updateTransientFor();
1605             }
1606         } finally {
1607             XToolkit.awtUnlock();
1608         }
1609     }
1610 
1611     /*
1612      * Sets the TRANSIENT_FOR hint to the given top-level window. This
1613      *  method is used when a window is modal blocked/unblocked or
1614      *  changed its state from/to NormalState to/from other states.
1615      * If window or transientForWindow are embedded frames, the containing
1616      *  top-level windows are used.
1617      *
1618      * @param window specifies the top-level window that the hint
1619      *  is to be set to
1620      * @param transientForWindow the top-level window
1621      * @param updateChain specifies if next/prevTransientFor fields are
1622      *  to be updated
1623      * @param allStates if set to <code>true</code> then TRANSIENT_FOR hint
1624      *  is set regardless of the state of window and transientForWindow,
1625      *  otherwise it is set only if both are in the same state
1626      */
1627     static void setToplevelTransientFor(XWindowPeer window, XWindowPeer transientForWindow,
1628                                                 boolean updateChain, boolean allStates)
1629     {
1630         if ((window == null) || (transientForWindow == null)) {
1631             return;
1632         }
1633         if (updateChain) {
1634             window.prevTransientFor = transientForWindow;
1635             transientForWindow.nextTransientFor = window;
1636         }
1637         if (window.curRealTransientFor == transientForWindow) {
1638             return;
1639         }
1640         if (!allStates && (window.getWMState() != transientForWindow.getWMState())) {
1641             return;
1642         }
1643         if (window.getScreenNumber() != transientForWindow.getScreenNumber()) {




1603 
1604                 updateTransientFor();
1605             }
1606         } finally {
1607             XToolkit.awtUnlock();
1608         }
1609     }
1610 
1611     /*
1612      * Sets the TRANSIENT_FOR hint to the given top-level window. This
1613      *  method is used when a window is modal blocked/unblocked or
1614      *  changed its state from/to NormalState to/from other states.
1615      * If window or transientForWindow are embedded frames, the containing
1616      *  top-level windows are used.
1617      *
1618      * @param window specifies the top-level window that the hint
1619      *  is to be set to
1620      * @param transientForWindow the top-level window
1621      * @param updateChain specifies if next/prevTransientFor fields are
1622      *  to be updated
1623      * @param allStates if set to {@code true} then TRANSIENT_FOR hint
1624      *  is set regardless of the state of window and transientForWindow,
1625      *  otherwise it is set only if both are in the same state
1626      */
1627     static void setToplevelTransientFor(XWindowPeer window, XWindowPeer transientForWindow,
1628                                                 boolean updateChain, boolean allStates)
1629     {
1630         if ((window == null) || (transientForWindow == null)) {
1631             return;
1632         }
1633         if (updateChain) {
1634             window.prevTransientFor = transientForWindow;
1635             transientForWindow.nextTransientFor = window;
1636         }
1637         if (window.curRealTransientFor == transientForWindow) {
1638             return;
1639         }
1640         if (!allStates && (window.getWMState() != transientForWindow.getWMState())) {
1641             return;
1642         }
1643         if (window.getScreenNumber() != transientForWindow.getScreenNumber()) {


< prev index next >