magefree / Launcher

Launcher to install and start XMage
11 stars 14 forks source link

GUI deadlock, maven build fix, better version comparison to detect the need of update. #2

Closed rkfg closed 8 years ago

rkfg commented 8 years ago

On two my machines there's a deadlock happening on launch resulting in an empty gray window. Not every time, though, so looks like a race condition. May be platform specific, my config: Intel Core i7-2600, 32Gb RAM, NVIDIA GeForce 770 GTX driver v361.28, Debian Stretch GNU/Linux amd64, Awesome WM 3.5.6, kernel v4.3

I know about issues with OpenJDK+AwesomeWM, already have:

_JAVA_AWT_WM_NONREPARENTING=1
AWT_TOOLKIT=MToolkit
_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dsun.java2d.opengl=true" (removing the last option doesn't help)
wmname LG3D

Turning these on and off doesn't change much. Sometimes the launcher works but after restart it doesn't. Pure luck i.e. Tried Java 7 and 8, tried different Look'n'Feel Swing options. Hence decided to dig the source and fix it once and for all. Probably succeeded.

The main issue is incorrect usage of SwingWorker and believing that JTextArea#append is thread safe (it's not since Java 7). I refactored DownloadTask to use progress/publish method so it prints messages and updates the progress bar from the EDT.

LevelX2 commented 8 years ago

Hey sounds very promising. When I'm back home I'll megr it and check if I can build and all works for me.

Thanks for your contribution.

cskau commented 8 years ago

For what it's worth I can confirm this does appear to fix the issue on my machine as well.

LevelX2 commented 8 years ago

The new launcher version is active now if you (re)start the launcher.

rkfg commented 8 years ago

Thank you, will try to install the game from scratch!