mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-13 00:18:59 +00:00
7161575: [macosx] On MacOSX port java.awt.Toolkit.is/setDynamicLayout() are not consistent
Reviewed-by: anthony, art
This commit is contained in:
parent
4cb70c3b15
commit
c9775371ce
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user