ImageJ 1.52p on High DPI screen

I have a System76 PopOS (Ubuntu) laptop with HighDPI screen. Some tools I use (like AFNI’s SUMA) can not run in High DPI mode, while others do, so I switch between modes. ImageJ looks OK in both modes. However, it remembers the window position when I exit the program and returns the menu bar to this location when I restart. Unfortunately, it does not check that the menu position is on the visible portion of the screen. It does not appear on one of my virtual screens, rather is on a location of the active screen I can not see. For example, I run high DPI that is 2x2 low DPI. If I close ImageJ in High DPI in any quadrant except the upper left and then switch to low DPI, the program opens but I can not interact with it. Is there a solution for this issue?

1 Like

ImageJ does check that the main window is on the primary screen but the check fails if the main window is below the primary screen. This is fixed in the latest ImageJ daily build (1.52r6). If upgrading does not fix the problem, report the values of “Screen size:”, "Max window bounds:, “Monitor1:” and “Monitor2:” from the Plugins>Utilities>ImageJ Properties command. It should look something like:

  Screen size: 1680x1050
  Max window bounds: x=63,y=22,width=1617,height=1028
  Monitor1: x=0,y=0,width=1680,height=1050
  Monitor2: x=137,y=1050,width=1360,height=768
1 Like

@Wayne thanks for your rapid response. As context, HiDPI works on my MacOS, but the GPU-based volume renders (e.g. 3D Viewer plugin which uses SciJava) does not support modern Macs. Other useful posts describing HiDPI Linux are here and here.

I upgraded to 1.52r6 but this does not change the behavior: if ImageJ is run in HiDPI the font sizes are small, further this mode is not compatible with some other tools I use. If I run ImageJ in LoDPI the font sizes are fine but

  1. If I closed ImageJ from HiDPI in any quadrant but the upper left and start in LoDPI, ImageJ appears off screen.
  2. The startup splash screen and many dialogs appear on the far right side of the screen, with the right half of the dialog off the screen, requiring me to re-center the dialog to interact with it.

The Plugins>Utilities>ImageJ Properties command does not distinguish between the modes (and does not include a “Monitor1:” type section:

  java.version: 1.8.0_172
  java.vendor: Oracle Corporation
  os.name: Linux
  os.version: 4.15.0-38-generic
  os.arch: amd64
...
  IJ.getVersion: 2.0.0-rc-71/1.52r
  IJ.getFullVersion: 1.52r06
  IJ.javaVersion: 8
  IJ.isLinux: true
  IJ.isMacintosh: false
  IJ.isMacOSX: false
  IJ.isWindows: false
  IJ.is64Bit: true
....

  Memory in use: 38MB of 8610MB (<1%)
  Screen size: 3840x2160
  Max window bounds: x=96,y=64,width=3744,height=2096
...

Likewise, xrandr and xdpyinfo do not distinguish between these modes, though xrdb does. This GTK2 override is described here.

HIGH DPI MODE:


$ xrandr
Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
...
eDP-1-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 345mm x 194mm

$ xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    3840x2160 pixels (1016x572 millimeters)
  resolution:    96x96 dots per inch
  
$ xrdb -query | grep dpi
Xft.dpi:	192

LoDPI:

$ xrandr
Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
...
eDP-1-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 345mm x 194mm

$ xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    3840x2160 pixels (1016x572 millimeters)
  resolution:    96x96 dots per inch

$ xrdb -query | grep dpi
Xft.dpi:	96

By the way, as noted here for my HiDPI setting I can use the Edit>Options>Appearance get teh HiDPI mode looking pretty good (for me, “Menu font size” 16 and “GUI scale” 2 seem pretty good). This is a workable solution as long as I remember to swtich to HiDPI mode. The challenge is that if I accidentally launch in LoDPI mode, everything can appear off screen.

This appears to be a bug in Java and/or Linux. Java reports that the screen size in LoDPI mode is 3840x2160 but it is actually something like 1920x1080. The only solution I see is to avoid LoDPI mode.

@Wayne thanks for your feedback. I did launch ImageJ using Java 11 using the command
$HOME/Fiji.app/ImageJ-linux64 --default-gc --java-home /usr/lib/jvm/java-11-openjdk-amd64
with ImageJ still reporting 3840x2160 screen resolution (and dialogs not respective the screen boundaries) while native GTK2 applications detect 1920x1080. As you suggest, I will run ImageJ on HiDPI mode on this laptop in the future