diff options
author | Sven Gothel <[email protected]> | 2011-12-20 20:43:56 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-20 20:43:56 +0100 |
commit | baca92ef4cead762663efa61e81584c8a8ece7b4 (patch) | |
tree | 0edab2eb86cba79ececdbb150a6f38dc828a3d5b /src/newt/classes/jogamp | |
parent | 734a9dbc4b8eaedf0e0bb698b8692ebd31ff8707 (diff) |
NEWT initScreenModeStatus(): Issue setScreenSize() to update screen size based on native RANDR (more correct)
Clarify Screen's getWidth(), getHeight() values (-> rotated)
Also add DEBUG output for collected native modes and nativeIdx mapping.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/ScreenImpl.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java index 6ea9aff38..c520d0d63 100644 --- a/src/newt/classes/jogamp/newt/ScreenImpl.java +++ b/src/newt/classes/jogamp/newt/ScreenImpl.java @@ -499,6 +499,8 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { if(null == currentSM) { throw new InternalError("getCurrentScreenModeImpl() == null"); } + // Update rotated Screen size, since native RandR impl. is more correct. + setScreenSize(currentSM.getRotatedWidth(), currentSM.getRotatedHeight()); ArrayHashSet<ScreenMode> screenModes = collectNativeScreenModes(screenModesIdx2NativeIdx); if(screenModes.size()==0) { @@ -549,9 +551,18 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { int nativeId = smProps[0]; int screenModeIdx = ScreenModeUtil.streamIn(resolutionPool, surfaceSizePool, screenSizeMMPool, monitorModePool, screenModePool, smProps, 1); + if(DEBUG) { + System.err.println("ScreenImpl.collectNativeScreenModes: #"+num+": idx: "+nativeId+" native -> "+screenModeIdx+" newt"); + } + if(screenModeIdx >= 0) { screenModesIdx2NativeId.put(screenModeIdx, nativeId); } + } else if(DEBUG) { + System.err.println("ScreenImpl.collectNativeScreenModes: #"+num+": smProps: "+(null!=smProps)+ + ", len: "+(null != smProps ? smProps.length : 0)+ + ", bpp: "+(null != smProps && 0 < smProps.length ? smProps[idxBpp] : 0)+ + " - DROPPING"); } num++; } while ( null != smProps && 0 < smProps.length ); |