UprootLabs / swing-htabs

Hierarchical tabs for Swing
Apache License 2.0
11 stars 3 forks source link

Problems with non-reparenting window manager support. #22

Open pejorativefox opened 9 years ago

pejorativefox commented 9 years ago

Running swing-htabs-v0.0.jar while using a non-reparenting window manage like AwesomeWM, Xmonad, or dwm only a grey box is shown. This seems to be a problem with java having a hard coded list of window managers that support this parenting strategy. Some apps like minecraft have fixed this issue in current versions, but was present in earlier versions.

There are solutions and tools for users to fix this behavior. OpenJDK supports an environment variable, and there are a few tools that can 'fudge' the name of the window manager to one supported on the list.

Info from arch wiki's XMonad page: "The standard Java GUI toolkit has a hard-coded list of "non-reparenting" window managers. Since xmonad is not in that list, there can be some problems with running some Java applications. One of the most common problems is "gray blobs", when the Java application renders as a plain gray box instead of rendering the GUI."

This is reproducible for sure on Ubuntu 14.04 64bit under the Awesome window manager using java version "1.7.0_72", but I think it's present on all combinations and versions.

hrj commented 9 years ago

According to @chris-statzer the default LAF does works fine.

pejorativefox commented 9 years ago

With system LAF as default

java_awesome_parenting

pejorativefox commented 9 years ago

With cross-platform LAF as default

... and later switched to GTK+ java_awesome_parenting_working

hrj commented 9 years ago

@chris-statzer has some workarounds on the environment side, that he says will share later.

On our side, we could provide a property or command-line parameter that stops use of the system LAF upon startup.

Since this is a demo app, it's not a big deal, but the discussion here will be also useful in gngr, since we are using the system LAF there too.

hrj commented 9 years ago

I was able to reproduce this problem on

debian + xmonad + openjdk8 + gngr-v0-0-0.jar

I guess it is similar to the problem that @chris-statzer faced with swing-htabs.

Both the workarounds mentioned in this wiki page worked fine:

  1. Setting the environment variable _JAVA_AWT_WM_NONREPARENTING=1
  2. calling SetWMName with LG3D

I have not tried other tiling WM yet.

hrj commented 9 years ago

wmname seems to achieve the same effect as the second workaround above.

(tip from @chris-statzer on IRC)