aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/Screen.java4
-rw-r--r--src/newt/classes/jogamp/newt/ScreenImpl.java11
2 files changed, 13 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java
index d25d3e7ac..b6d863965 100644
--- a/src/newt/classes/com/jogamp/newt/Screen.java
+++ b/src/newt/classes/com/jogamp/newt/Screen.java
@@ -120,12 +120,12 @@ public abstract class Screen {
public abstract int getIndex();
/**
- * @return the current screen width
+ * @return the current screen width, reflecting {@link ScreenMode} rotation
*/
public abstract int getWidth();
/**
- * @return the current screen height
+ * @return the current screen height, reflecting {@link ScreenMode} rotation
*/
public abstract int getHeight();
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 );