tonikelope / megabasterd

Yet another unofficial (and ugly) cross-platform MEGA downloader/uploader/streaming suite.
GNU General Public License v3.0
4.53k stars 595 forks source link

megabasterd fails to run on Linux systems with 10-bit color #574

Open nick-s-b opened 10 months ago

nick-s-b commented 10 months ago

Hello everyone! I'm getting this error when I start megabasterd:

$ megabasterd
Picked up _JAVA_OPTIONS: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  72 (X_PutImage)
  Serial number of failed request:  190
  Current serial number in output stream:  200

I first suspected _JAVA_OPTIONS so I tried removing the existing GTK option:

$ _JAVA_OPTIONS="" megabasterd
Picked up _JAVA_OPTIONS: 
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  72 (X_PutImage)
  Serial number of failed request:  190
  Current serial number in output stream:  200

Same error.

I did a lot of searching and I started to think this is because I use 10-bit color under Linux. I haven't had many issues with using 10-bit color but it seems that the "fix" for many Java programs is to use -Dsun.java2d.opengl=true in _JAVA_OPTIONS.

$ _JAVA_OPTIONS="-Dsun.java2d.opengl=true" megabasterd
Picked up _JAVA_OPTIONS: -Dsun.java2d.opengl=true
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  72 (X_PutImage)
  Serial number of failed request:  190
  Current serial number in output stream:  200

Same error. One last try:

java -jar -Dsun.java2d.opengl=true /usr/share/java/megabasterd/megabasterd.jar
Picked up _JAVA_OPTIONS: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dsun.java2d.opengl=true 
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  72 (X_PutImage)
  Serial number of failed request:  190
  Current serial number in output stream:  200

Looks like a common fix for other Java programs does not work for megabasterd.

Does anyone know how to fix this? Thanks!

Cybereu commented 9 months ago

I dont know, mine just run well with java 11.