< prev index next >
src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java
Print this page
*** 264,281 ****
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());
} else {
! wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
}
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
insLog.finer("FRAME_EXTENTS: {0}", wm_set_insets);
}
--- 264,284 ----
private Insets getWMSetInsets(XAtom changedAtom) {
if (isEmbedded()) {
return null;
}
! if (wm_set_insets != null && !isNull(wm_set_insets)) {
return wm_set_insets;
}
if (changedAtom == null) {
wm_set_insets = XWM.getInsetsFromExtents(getWindow());
} else {
! Insets insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
! if (insets != null && !isNull(insets)) {
! wm_set_insets = insets;
! }
}
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
insLog.finer("FRAME_EXTENTS: {0}", wm_set_insets);
}
*** 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();
--- 346,356 ----
setReparented(true);
insets_corrected = false;
// Check if we have insets provided by the WM
Insets correctWM = getWMSetInsets(null);
! if (correctWM != null && !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,378 ****
insLog.finer("correctWM insets are not available, waiting for configureNotify");
}
}
}
! if (correctWM != null) {
handleCorrectInsets(correctWM);
}
}
} finally {
XToolkit.awtUnlock();
--- 371,381 ----
insLog.finer("correctWM insets are not available, waiting for configureNotify");
}
}
}
! if (correctWM != null && !isNull(correctWM)) {
handleCorrectInsets(correctWM);
}
}
} finally {
XToolkit.awtUnlock();
*** 396,411 ****
//Fix for 6318109: PIT: Min Size is not honored properly when a
//smaller size is specified in setSize(), XToolkit
//update minimum size hints
updateMinSizeHints();
}
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
insLog.finer("Dimensions before reparent: " + dimensions);
}
! dimensions.setInsets(getRealInsets());
insets_corrected = true;
if (isMaximized()) {
return;
}
--- 399,422 ----
//Fix for 6318109: PIT: Min Size is not honored properly when a
//smaller size is specified in setSize(), XToolkit
//update minimum size hints
updateMinSizeHints();
+ } else {
+ return;
}
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
insLog.finer("Dimensions before reparent: " + dimensions);
}
! dimensions.setInsets(correctWM);
! if (dimensions.isClientSizeSet()) {
! Dimension cs = dimensions.getClientSize();
! dimensions.setClientSize(
! cs.width - correction.left - correction.right,
! cs.height - correction.top - correction.bottom);
! }
insets_corrected = true;
if (isMaximized()) {
return;
}
*** 714,734 ****
&& getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
insLog.fine("- visible but not reparented, skipping");
return;
}
//Last chance to correct insets
! if (!insets_corrected && getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
long parent = XlibUtil.getParentWindow(window);
Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
if (correctWM != null) {
insLog.finer("Configure notify - insets : " + correctWM);
} else {
insLog.finer("Configure notify - insets are still not available");
}
}
! if (correctWM != null) {
handleCorrectInsets(correctWM);
} else {
//Only one attempt to correct insets is made (to lower risk)
//if insets are still not available we simply set the flag
insets_corrected = true;
--- 725,745 ----
&& getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
insLog.fine("- visible but not reparented, skipping");
return;
}
//Last chance to correct insets
! if (getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
long parent = XlibUtil.getParentWindow(window);
Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
if (correctWM != null) {
insLog.finer("Configure notify - insets : " + correctWM);
} else {
insLog.finer("Configure notify - insets are still not available");
}
}
! if (correctWM != null && !isNull(correctWM)) {
handleCorrectInsets(correctWM);
} else {
//Only one attempt to correct insets is made (to lower risk)
//if insets are still not available we simply set the flag
insets_corrected = true;
< prev index next >