From 7982cc52344c025c40da45fd4b946056a63bc855 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 31 Jan 2023 22:57:23 +0100 Subject: NEWT Soft-PixelScale (p7): get{Global->}PixelScaleEnv(..): Support per monitor values w/ QT_SCREEN_SCALE_FACTORS syntax, use for X11 Per-monitor values are parsed if value is not a float and stored in a given Map, parallel to a detected global_pixel_scale_xy. The per-monitor value syntax matches QT_SCREEN_SCALE_FACTORS, i.e. the regular expression '(=;)+', 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" --- .../com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/test/com/jogamp') 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 supportedModes = new ArrayHashSet(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()); -- cgit v1.2.3