RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
795 stars 260 forks source link

Blank screen on start-up under tiling window managers (bspwm, dwm) #2904

Closed BlueDrink9 closed 3 years ago

BlueDrink9 commented 3 years ago

Describe the bug

App main screen is completely blank. Beige screen, no menus or map. Keyboard shortcuts can bring up file menus (ctrl+o,n,s,a).

To Reproduce

  1. Open app
  2. view splash screen with icon, which then shuts
  3. Main view opens, and it is just blank beige with no UI elements.

Expected behavior

Some sort of menu to open

MapTool Info

Desktop (please complete the following information):

Additional context

Using bspwm as WM. I'll test it again shortly with plasma-only on another user account.

Customised desktop gtk and qt theme, might be relevant.

Attached log generated by maptools --debug MapTools1.10.0-beta.2.debug.log

GeorgeZack commented 3 years ago

Also am able to replicate the issue on 1.9.3

BlueDrink9 commented 3 years ago

@GeorgeZack was there a version that did work for you?

Phergus commented 3 years ago

@GeorgeZack same Linux distro and window manager?

GeorgeZack commented 3 years ago

@BlueDrink9 Same(ish) Linux distro, Artix Linux x86_64 (Kernal 5.13.12-artix1-1) Artix is based on Arch, so I would assume that this isn't going to cause an issue. Not the same window manager, I'm using dwm

I installed the program onto my machine via the AUR packages maptool and maptool-bin, but neither worked.

@BlueDrink9 I have been unable to figure out how to install older versions of the software via yay (pacman for AUR packages). Let me try again and test out versions.

Also, I noticed that your log said something along the lines of falling back to YQ themes. I had the same line in my log. Not sure if that matters.

GeorgeZack commented 3 years ago

Figured out how to get specific versions from yay, though I have not built from source. I tried using the old versions of maptool-bin from yay but trying 1.9.2 and 1.8.5 did not work.

I recognize that using the packages from a package manager isn't the same as just using different versions of the software. So I will try to build from source and see how that goes.

BlueDrink9 commented 3 years ago

I'd love to see a log from someone that isn't having this issue, to help self diagnosis

Azhrei commented 3 years ago

@BlueDrink9 I don't see anything in your log that points to any kind of graphical issue. I don't think a comparison log would be terribly useful.

If the entire window is missing UI elements, it sounds like the low-level Java libs that Swing uses are not talking to the GUI properly. You didn't say whether you were using Wayland or Xorg, but do keep trying other window managers (the WM adds properties to windows it manages, telling the GUI how to handle them, so a different WM may produce a different result). Please check whatever logs your GUI components produce (for example, Xorg produces a log file under /tmp, IIRC, and there may be a log from your WM in your home directory). There might even be messages straight from the video driver; try running dmesg -w in a terminal window when starting MT and keep an eye out for any new messages.

BlueDrink9 commented 3 years ago

bspwm is an Xorg manager. I'll try plain Plasma very soon.

BlueDrink9 commented 3 years ago

Nothing in the kernel/dmesg log or xorg logs.

BlueDrink9 commented 3 years ago

Plasma on its own works fine! Looks like it's a twm issue, if bspwm and dwm have the same problem. I'll have a fiddle. Is there anything I can do to help you get info about what they might be doing differently?

Azhrei commented 3 years ago

I'm glad you found a solution!

You might check the docs for the WMs that don't work and see if they turn on/off any particular window properties differently from Plasma. Things like backing store options, how blitting works, and so forth. It's been a long time since I played in Xorg world, so I don't know what all of the current properties might be.

(Thanks for finding it, though. Now I don't have to create a VM with Arch in it!)

BlueDrink9 commented 3 years ago

Telling bspwm not to manage maptool didn't work. Might be something to do with the wider window management environment. I know that bspwm doesn't have window decorations, although some apps (eg Brave) can override that and still end up with the old decorations I themed under plasma.

As an aside, the WM_CLASS for maptool is very unwieldy to use in scripts etc. (net-rptools-maptool-client-LaunchInstructions)

Azhrei commented 3 years ago

Perhaps use the StartupWMClass in your .desktop file??

BlueDrink9 commented 3 years ago

From here I got the idea to try a differing wmname $ wmname LG3D. That has fixed the issue.

Running maptool with $ _JAVA_AWT_WM_NONREPARENTING=1 /opt/maptool/bin/MapTool also fixes the issue

BlueDrink9 commented 3 years ago

I have modified maptool's .desktop file to Exec=_JAVA_AWT_WM_NONREPARENTING=1 /opt/maptool/bin/MapTool for now. Thank you for your help getting this issue sorted, I was gutted to find MapTool didn't work because it seemed the best of all the alternative open source VTTs.

I am concerned that updates will override this fix, and the .desktop file isn't being backed up, so I would like to find a tidier fix, or something I can apply to my $HOME folder

BlueDrink9 commented 3 years ago

I ended up adding this to /etc/profile.d/jre.sh. For now that will suit me (it seems to work well enough).

if [ "bspwm" == "$DESKTOP_SESSION" ] || \
  [ -z "$DESKTOP_SESSION" -a "$DEFAULT_SESSION" = "bspwm" ] || \
  [ "bspwm" == "$KDEWM" ] ; then
  export _JAVA_AWT_WM_NONREPARENTING=1
fi
GeorgeZack commented 3 years ago

Wow, that worked for me! Thanks for your help @BlueDrink9 !

Redecorating commented 3 years ago

setting _JAVA_AWT_WM_NONREPARENTING is also required on wayland sway, otherwise the window contents don't resize when the actual window is resized. Sway should be detectable by checking if $SWAYSOCK is set.