< prev index next >

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

Print this page

        

*** 39,48 **** --- 39,49 ---- abstract class XDecoratedPeer extends XWindowPeer { private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XDecoratedPeer"); private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XDecoratedPeer"); private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XDecoratedPeer"); private static final PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XDecoratedPeer"); + private static final int MAX_INSET_ATTEMPT = 100; // Set to true when we get the first ConfigureNotify after being // reparented - indicates that WM has adopted the top-level. boolean configure_seen; boolean insets_corrected;
*** 264,274 **** private Insets getWMSetInsets(XAtom changedAtom) { if (isEmbedded()) { return null; } ! if (wm_set_insets != null) { return wm_set_insets; } if (changedAtom == null) { wm_set_insets = XWM.getInsetsFromExtents(getWindow()); --- 265,275 ---- private Insets getWMSetInsets(XAtom changedAtom) { if (isEmbedded()) { return null; } ! if (!isNull(wm_set_insets)) { return wm_set_insets; } if (changedAtom == null) { wm_set_insets = XWM.getInsetsFromExtents(getWindow());
*** 343,353 **** setReparented(true); insets_corrected = false; // Check if we have insets provided by the WM Insets correctWM = getWMSetInsets(null); ! if (correctWM != null) { if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("wm-provided insets {0}", correctWM); } // If these insets are equal to our current insets - no actions are necessary Insets dimInsets = dimensions.getInsets(); --- 344,359 ---- setReparented(true); insets_corrected = false; // Check if we have insets provided by the WM Insets correctWM = getWMSetInsets(null); ! int maxAttempts = MAX_INSET_ATTEMPT; ! while (maxAttempts--> 0 && isNull(correctWM)) { ! Thread.yield(); ! correctWM = getWMSetInsets(null); ! } ! if (!isNull(correctWM)) { if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("wm-provided insets {0}", correctWM); } // If these insets are equal to our current insets - no actions are necessary Insets dimInsets = dimensions.getInsets();
*** 368,379 **** insLog.finer("correctWM insets are not available, waiting for configureNotify"); } } } ! if (correctWM != null) { handleCorrectInsets(correctWM); } } } finally { XToolkit.awtUnlock(); } --- 374,387 ---- insLog.finer("correctWM insets are not available, waiting for configureNotify"); } } } ! if (!isNull(correctWM)) { handleCorrectInsets(correctWM); + } else { + insets_corrected = false; } } } finally { XToolkit.awtUnlock(); }
< prev index next >