Skip to content

Commit

Permalink
Added documentation on xvfb
Browse files Browse the repository at this point in the history
  • Loading branch information
3arthqu4ke committed Nov 13, 2024
1 parent 2bfdfc6 commit 7acb022
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

import java.util.Locale;

/**
* Lwjgl 2.9.4 (Mc 1.12.2) crashes in Github actions with xvfb at getAvailableDisplayModes,
* because the array returned by XRandR.getResolutions is empty.
* This patches that by always using XF86VIDMODE instead of XRANDR.
*/
@CustomLog
public class XvfbLwjglTransformer extends AbstractClassTransformer {
public XvfbLwjglTransformer() {
Expand All @@ -17,6 +22,8 @@ public XvfbLwjglTransformer() {

@Override
protected void transform(ClassNode cn) {
// TODO: Actually isXrandrSupported can also be overriden by setting the system property LWJGL_DISABLE_XRANDR
// but this would theoretically cover the case when XF86VIDMODE is not supported?
for (MethodNode mn : cn.methods) {
if ("getBestDisplayModeExtension".equals(mn.name) && "()I".equals(mn.desc)) {
for (AbstractInsnNode insnNode : mn.instructions) {
Expand Down

0 comments on commit 7acb022

Please sign in to comment.