NetLogo icon indicating copy to clipboard operation
NetLogo copied to clipboard

[Bug] UI is too small on my hidpi screen (Archlinux with 2k screen)

Open itsaquestion opened this issue 9 years ago • 12 comments

Problem: UI is too small (and without AA), including fonts and controls , and "zoom" menu doesn't work for menu bar, tabs and tools bar.

Netlogo version : 6.0 Computer: Thinkpad X1 Carbon with 2560 x 1440 screen System: Archlinux + Cinnamon

itsaquestion avatar Jan 26 '17 17:01 itsaquestion

We appreciate the report, but we're unable to fix this at the current time. JEP 263 proposes HiDPI support for Windows and Linux users and is scheduled for inclusion in JDK 9. Unfortunately, JDK 9 isn't scheduled for release until late July 2017. Given the current speed and frequency of our release cycles, it will probably be at least 2 months after the release of JDK 9 before HiDPI support is available in NetLogo.

mrerrormessage avatar Jan 30 '17 15:01 mrerrormessage

I had this problem too.

Using https://github.com/kaueraal/run_scaled I am able to use NetLogo, as a new Xserver is spawned and scaled afterwards.

Netlogo version: 6.0 Computer : Lenovo Thinkpad P50 with 3840x2160 pixels on 15" System: Ubuntu 16.04.04 using Unity

JohannesTimm avatar Jun 02 '17 16:06 JohannesTimm

I have this problem too, and it's more acute for the System Dynamics modeler where there is no zooming at all. I think that giving the users the ability to select the font and/or use the system font would solve most of the problems without going into all the trouble with HiDPI support. Do you think that would be feasible to add to NetLogo?

achudnov avatar Sep 02 '17 00:09 achudnov

@JohannesTimm when I run "./run_scaled NetLogo" I get the error "xpra initialization error: cannot find any live servers to connect to". Would be grateful if you could describe your process in further detail.

SamuelHakansson avatar Mar 13 '18 16:03 SamuelHakansson

@SamuelHakansson there is not much detail to this, as it worked for me out of the box. I have both netlogo and run_scaled installed in separate directories in my users home directory. Under some circumstances the user might be needed to be added to the xpra group, one needs to read the logfiles that should be produced by xpra. My commandline looks like this : johannes@ThinkPad-P50:~$ run_scaled/run_scaled/run_scaled netlogo/NetLogo\ 6.0.1/NetLogo

The terminal output is then: `using systemd-run to wrap 'start' server command 'systemd-run' '--description' 'xpra-start' '--scope' '--user' '/usr/bin/xpra' 'start' ':9005488' '--xvfb=Xvfb +extension Composite -screen 0 1920x1080x24+32 -nolisten tcp -noreset -auth $XAUTHORITY' '--env=GDK_SCALE=1' '--env=GDK_DPI_SCALE=1' '--start-child=netlogo/NetLogo\ 6.0.1/NetLogo ' '--exit-with-children=yes' '--systemd-run=no' Running scope as unit run-rac1ee344f5b846b1aff2036525f3b35b.scope. seamless session now available on display :9005488 2018-03-23 16:13:24,648 Xpra gtk2 client version 2.2.5-r18663 64-bit 2018-03-23 16:13:24,649 running on Linux Ubuntu 16.04 xenial 2018-03-23 16:13:25,314 GStreamer version 1.8.3 for Python 2.7.12 64-bit 2018-03-23 16:13:25,499 No OpenGL_accelerate module loaded: No module named OpenGL_accelerate 2018-03-23 16:13:25,636 OpenGL enabled with Mesa DRI Intel(R) HD Graphics P530 (Skylake GT2) 2018-03-23 16:13:25,657 keyboard settings: rules=evdev, model=pc105, layout=de,us 2018-03-23 16:13:25,658 desktop size is 3840x2160 with 1 screen: 2018-03-23 16:13:25,658 :0.0 (1016x571 mm - DPI: 96x96) workarea: 3686x2103 at 154x57 2018-03-23 16:13:25,658 monitor 1 (346x194 mm - DPI: 281x282) 2018-03-23 16:13:25,658 upscaled by 200%, virtual screen size: 1920x1080 2018-03-23 16:13:25,659 :0.0 (1016x571 mm - DPI: 48x48) workarea: 1843x1051 at 77x28 2018-03-23 16:13:25,659 monitor 1 (346x194 mm - DPI: 140x141) 2018-03-23 16:13:25,705 Warning: invalid frame extents value '[0, 0, 0, 0, 0, 0, 67, 0]' 2018-03-23 16:13:25,705 this is probably a bug in 'Compiz' 2018-03-23 16:13:25,705 using '[0, 0, 67, 0]' instead 2018-03-23 16:13:25,711 keyboard layouts: de,us,de,us 2018-03-23 16:13:26,554 enabled fast mmap transfers using 256MB shared memory area 2018-03-23 16:13:26,554 Xpra X11 server version 2.2.5-r18663 64-bit 2018-03-23 16:13:26,554 running on Linux Ubuntu 16.04 xenial 2018-03-23 16:13:26,555 enabled remote logging 2018-03-23 16:13:26,565 Attached to :9005488 2018-03-23 16:13:26,566 (press Control-C to detach)

2018-03-23 16:13:26,568 server does not support xi input devices 2018-03-23 16:13:26,569 server uses: xtest 2018-03-23 16:13:26,592 Warning: invalid frame extents value '[0, 0, 0, 0, 0, 0, 67, 0]' 2018-03-23 16:13:26,592 this is probably a bug in 'Compiz' 2018-03-23 16:13:26,592 using '[0, 0, 67, 0]' instead 2018-03-23 16:13:27,379 sound output using pulseaudio device: 2018-03-23 16:13:27,379 sound output 'Built-in Audio Analog Stereo' 2018-03-23 16:13:27,897 sound output using audio codec opus ` And netlogo opens in with 2 times scaled resolution. I hope that this helps, however if the path to the netlogo executable is not correct, you might get the same error you were seeing, as there is no other error message on the terminal (but on the logfiles one finds that there is no child process that xpra could open). If it still won't work try using xpra manually to figure out whats not happening.

JohannesTimm avatar Mar 23 '18 15:03 JohannesTimm

a workaround has been suggested here: https://github.com/NetLogo/NetLogo/issues/1638#issue-336711870

SethTisue avatar Jun 28 '18 19:06 SethTisue

I just had to go through it (Ubuntu 20.04 for the record), so here is how I got the workaround going:

  1. Download OpenJDK 9.0.4 from here: https://jdk.java.net/archive/
  2. Extract it to whatever desired folder.
  3. Edit the app.runtime setting in the NetLogo.cfg file to point to the extracted folder.

Then in a terminal:

  1. cd into the OpenJDK's lib/ folder and do a ln -s ./ amd64 to make the folder structure match what the NetLogo executable was expecting to find.
  2. Then cd to the NetLogo folder and do export GDK_SCALE=3 then ./NetLogo and you should see NetLogo start scaled up 3 times. I put these two commands in a shell script so I can just run that to get going without affecting the scaling of anything else I happen to launch.

LaCuneta avatar Oct 29 '20 15:10 LaCuneta

Instead of the command line export, I found it helpful to add -Dsun.java2d.uiScale=3 to the [JVMOptions] section of the .cfg file.

TheBizzle avatar Dec 13 '21 18:12 TheBizzle

With #2045 being merged and Java 17 being bundled, I re-tested this. Unfortunately NetLogo still doesn't pick up the default system scaling, but you can now use the -Dsun.java2d.uiScale or GDK_SCALE settings to get things working without installing a different Java version. I'll keep this issue open as we'd much prefer NetLogo just follow what the system uses without any config file modifications.

LaCuneta avatar Aug 26 '22 14:08 LaCuneta

With #2045 being merged and Java 17 being bundled, I re-tested this. Unfortunately NetLogo still doesn't pick up the default system scaling, but you can now use the -Dsun.java2d.uiScale or GDK_SCALE settings to get things working without installing a different Java version. I'll keep this issue open as we'd much prefer NetLogo just follow what the system uses without any config file modifications.

today ths .cfg is missing, all I can see is this string into netlogo-gui.sh

JVM_OPTS=(-Xmx1024m -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir="${BASE_DIR}/extensions" -Dnetlogo.models.dir="${BASE_DIR}/models" --add-exports=java.base/java.lang=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.desktop/sun.java2d=ALL-UNNAMED  )
ARGS=()

how can i resolve this?

mich2k avatar Sep 25 '23 09:09 mich2k

@mich2k If you're running NetLogo 6.3, the *.cfg file locations are under lib/app in the NetLogo install folder.

LaCuneta avatar Sep 25 '23 15:09 LaCuneta

@mich2k If you're running NetLogo 6.3, the *.cfg file locations are under lib/app in the NetLogo install folder.

Thank you, you literally saved me I added this line to NetLogo.cfg and NetLogo3D.cfg (for now) java-options=-Dsun.java2d.uiScale=3 Writing this down so there is a copy&paste ready solution in the issue

mich2k avatar Sep 25 '23 19:09 mich2k