提交 6375b793 编写于 作者: S serb

7161575: [macosx] On MacOSX port java.awt.Toolkit.is/setDynamicLayout() are not consistent

Reviewed-by: anthony, art
上级 64410463
......@@ -53,7 +53,12 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
private Clipboard clipboard;
private MouseInfoPeer mouseInfoPeer;
public LWToolkit() {
/**
* Dynamic Layout Resize client code setting.
*/
private volatile boolean dynamicLayoutSetting = true;
protected LWToolkit() {
}
/*
......@@ -561,4 +566,37 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
((LWWindowPeer)w.getPeer()).ungrab(false);
}
}
@Override
protected final Object lazilyLoadDesktopProperty(final String name) {
if (name.equals("awt.dynamicLayoutSupported")) {
return isDynamicLayoutSupported();
}
return super.lazilyLoadDesktopProperty(name);
}
@Override
public final void setDynamicLayout(final boolean dynamic) {
dynamicLayoutSetting = dynamic;
}
@Override
protected final boolean isDynamicLayoutSet() {
return dynamicLayoutSetting;
}
@Override
public final boolean isDynamicLayoutActive() {
// "Live resizing" is active by default and user's data is ignored.
return isDynamicLayoutSupported();
}
/**
* Returns true if dynamic layout of Containers on resize is supported by
* the underlying operating system and/or window manager.
*/
protected final boolean isDynamicLayoutSupported() {
// "Live resizing" is supported by default.
return true;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册