aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-01-31 22:57:23 +0100
committerSven Gothel <[email protected]>2023-01-31 22:57:23 +0100
commit7982cc52344c025c40da45fd4b946056a63bc855 (patch)
tree821c49296827111efc7b4b207ae4cc2726320559 /src/test/com/jogamp
parentad38d1559854985b1131e5b6c7274a392b5bc265 (diff)
NEWT Soft-PixelScale (p7): get{Global->}PixelScaleEnv(..): Support per monitor values w/ QT_SCREEN_SCALE_FACTORS syntax, use for X11v2.4.0
Per-monitor values are parsed if value is not a float and stored in a given Map<String,float[2]>, parallel to a detected global_pixel_scale_xy. The per-monitor value syntax matches QT_SCREEN_SCALE_FACTORS, i.e. the regular expression '(<string>=<float>;)+', e.g. QT_SCREEN_SCALE_FACTORS='DP-1=1.25;DP-2=1.25;HDMI-1=1.25;' The per-monitor value is preferred and on X11 stored within the MonitorDevice, matching the MonitorDevice's name. The following env-var names are searched on X11: "QT_SCREEN_SCALE_FACTORS", "QT_SCALE_FACTOR", "GDK_SCALE", "SOFT_SCALE"
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
index 78f59931a..a001383b8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
@@ -110,20 +110,22 @@ public class TestScreenMode00aNEWT extends UITestCase {
final long monitor_handle = -1;
final int monitor_id = -1;
+ final String monitor_name = "DP-1";
final DimensionImmutable sizeMM = new Dimension(50, 50);
final Rectangle viewport = new Rectangle(0, 0, 1920, 1080);
final ArrayHashSet<MonitorMode> supportedModes = new ArrayHashSet<MonitorMode>(false, ArrayHashSet.DEFAULT_INITIAL_CAPACITY, ArrayHashSet.DEFAULT_LOAD_FACTOR);
supportedModes.add(modeOut);
- final MonitorDevice monOut = new MonitorDeviceImpl(null, monitor_handle, monitor_id, false, true, sizeMM, modeOut, null, viewport, viewport, supportedModes);
+ final MonitorDevice monOut = new MonitorDeviceImpl(null, monitor_handle, monitor_id, monitor_name, false, true, sizeMM, modeOut, null, viewport, viewport, supportedModes);
System.err.println("01 out : "+monOut);
cache.monitorDevices.add(monOut);
{
final int[] props = MonitorModeProps.streamOutMonitorDevice(monOut);
- final MonitorDevice monIn = MonitorModeProps.streamInMonitorDevice(cache, null, monitor_handle, null, false /* invscale_wuviewport */, props, 0, null);
+ final MonitorDevice monIn = MonitorModeProps.streamInMonitorDevice(cache, null, monitor_handle, monitor_name, null, false /* invscale_wuviewport */, props, 0, null);
System.err.println("01 in : "+monIn);
Assert.assertEquals(monOut.getHandle(), monIn.getHandle());
Assert.assertEquals(monOut.getId(), monIn.getId());
+ Assert.assertEquals(monOut.getName(), monIn.getName());
Assert.assertEquals(monOut.isClone(), monIn.isClone());
Assert.assertEquals(monOut.isPrimary(), monIn.isPrimary());
Assert.assertEquals(monOut.getViewport(), monIn.getViewport());