dslabs icon indicating copy to clipboard operation
dslabs copied to clipboard

Visual debugger display too small on Arch with Xmonad WM

Open Lawqup opened this issue 2 years ago • 3 comments

Describe the bug When running the visual debugger using either ./run-tests.py .. --debug ... or ./run-tests.py .. --start-viz ... the display is very small and cannot be resized.

Screenshots image

Environment

  • OS: Arch Linux
  • Window manager: XMonad
  • JDK (output of java --version): openjdk 17.0.6 2023-01-17

Lawqup avatar Feb 19 '23 21:02 Lawqup

Ah, XMonad makes sense. I run i3 and haven't had any issues. I've also run it on GNOME without issue.

A few things:

  1. Has the visual debugger ever worked normally?
  2. Is the window maximized or did you maximize it in the past? The debugger tries to remember the size and state of the window and restores that on startup. Try wiping out ~/.java/.userPrefs/dslabs.
  3. Can you put the window into floating mode? I don't know how to do this on XMonad, but on i3 the default keyboard shortcut is Alt+Shift+Space. Does everything properly resize in floating mode?
  4. The visual debugger is a Swing application. Some quick searching suggests that this might fix the issue: https://stackoverflow.com/a/38621162/1532134

emichael avatar Feb 19 '23 22:02 emichael

4 Fixed the issue! I wonder why this occurs....

Thanks!

Lawqup avatar Feb 21 '23 02:02 Lawqup

This page has a bit more: https://wiki.haskell.org/Xmonad/Frequently_asked_questions#Problems_with_Java_applications.2C_Applet_java_console

It appears that Xmonad is non-reparenting, and the Java GUI library doesn't properly recognize this fact.

It also looks like a better version of 4 is to set _JAVA_AWT_WM_NONREPARENTING=1 somewhere (like .profile); you might run into issues with GTK with the solution from SO.

I'm going to leave this issue open for now. I don't particularly want to install Xmonad to test, but I bet you can detect Xmonad and set the _JAVA_AWT_WM_NONREPARENTING=1 environment variable in Java. If you (or anyone else) wants to do that, the right place is likely here where there are already some other platform-specific hacks: https://github.com/emichael/dslabs/blob/4c3c7c6cf4a6a0547b2b1be3e3c6b4822e5c630c/framework/tst/dslabs/framework/testing/visualization/DebuggerWindow.java#L95-L122

emichael avatar Feb 21 '23 03:02 emichael