diff options
author | Sven Gothel <[email protected]> | 2015-09-26 09:56:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-09-26 09:56:06 +0200 |
commit | b3ecc88efca2a2f969e1e5a375086148821ee3c5 (patch) | |
tree | e7932216c92139b4913e073d01321711f4217abf /src/nativewindow/classes/jogamp | |
parent | cff96a3e4811e9dc1dfe170dec89d785938ea904 (diff) |
Bug 1232 - NEWT Translucent Decorated Windows Not Working On Windows >= 8 (Lack of Aero / Blur )
- Wrap GDI::DwmIsCompositionEnabled() in GDIUtil,
so it always returns true if Windows >= 8 (even if not manifested)
- Nothing we seem to be able to do about the lack of Aero,
i.e. blur effect of decorated windows
- Undecorated windows work well though ..
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java index bdf9630af..7c01d7b2e 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java @@ -32,6 +32,8 @@ import com.jogamp.nativewindow.NativeWindowException; import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.common.ExceptionUtils; +import com.jogamp.common.os.Platform; +import com.jogamp.common.util.VersionNumber; import jogamp.nativewindow.NWJNILibLoader; import jogamp.nativewindow.Debug; @@ -122,6 +124,30 @@ public class GDIUtil implements ToolkitProperties { return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y); } + /** + * Windows >= 8, even if not manifested + * @see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx + */ + private static final VersionNumber Win8Version = new VersionNumber(6, 2, 0); + + /** + * Wrapper for {@link GDI#DwmIsCompositionEnabled()} + * taking the Windows 8 version into account. + * <p> + * If Windows version >= {@link #Win8Version} method always returns {@code true}, + * otherwise value of {@link GDI#DwmIsCompositionEnabled()} is returned. + * </p> + * @see https://msdn.microsoft.com/en-us/library/windows/desktop/aa969518%28v=vs.85%29.aspx + */ + public static boolean DwmIsCompositionEnabled() { + final VersionNumber winVer = Platform.getOSVersionNumber(); + if( winVer.compareTo(Win8Version) >= 0 ) { + return true; + } else { + return GDI.DwmIsCompositionEnabled(); + } + } + public static boolean IsUndecorated(final long win) { return IsUndecorated0(win); } |