< prev index next >
src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java
Print this page
@@ -264,10 +264,16 @@
private static Insets copy(Insets i) {
return new Insets(i.top, i.left, i.bottom, i.right);
}
+ private Insets copyAndScaleDown(Insets i) {
+ return new Insets(scaleDown(i.top), scaleDown(i.left),
+ scaleDown(i.bottom), scaleDown(i.right));
+ }
+
+
// insets which we get from WM (e.g from _NET_FRAME_EXTENTS)
private Insets wm_set_insets;
private Insets getWMSetInsets(XAtom changedAtom) {
if (isEmbedded()) {
@@ -287,11 +293,11 @@
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
insLog.finer("FRAME_EXTENTS: {0}", wm_set_insets);
}
if (wm_set_insets != null) {
- wm_set_insets = copy(wm_set_insets);
+ wm_set_insets = copyAndScaleDown(wm_set_insets);
}
return wm_set_insets;
}
private void resetWMSetInsets() {
@@ -384,10 +390,13 @@
applyGuessedInsets();
return;
}
} else {
correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent());
+ if (correctWM != null) {
+ correctWM = copyAndScaleDown(correctWM);
+ }
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
if (correctWM != null) {
insLog.finer("correctWM {0}", correctWM);
} else {
@@ -468,10 +477,13 @@
return copy(currentInsets);
} else {
Insets res = getWMSetInsets(null);
if (res == null) {
res = XWM.getWM().guessInsets(this);
+ if (res != null) {
+ res = copyAndScaleDown(res);
+ }
}
return res;
}
}
}
@@ -754,11 +766,11 @@
} else {
insLog.finer("Configure notify - insets are still not available");
}
}
if (correctWM != null) {
- handleCorrectInsets(correctWM);
+ handleCorrectInsets(copyAndScaleDown(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 >