Skip to content

feat: lwjglx-awt library update (lwjgl3) - v0.2.5 - #2980

Draft
JNightRider wants to merge 3 commits into
jMonkeyEngine:masterfrom
JNightRider:feature/lwjglx-awt-v0.2.5
Draft

JNightRider wants to merge 3 commits into
jMonkeyEngine:masterfrom
JNightRider:feature/lwjglx-awt-v0.2.5

Conversation

@JNightRider

Copy link
Copy Markdown
Contributor

This PR updates the lwjglx-awt library, a version published by jme3 is currently being used (this occurred due to issues with releasing a new version from the main repository); however, since this is no longer an issue, the library is being updated to the latest version from the main repository.

This brings new changes: there is now support for EGL contexts in XWayland (this does not mean X11 is not used; it remains present for window management).

Additionally, this PR would resolve issue #2602 (although the problem has already been partially resolved by PR #2645, it remains open; therefore, I suggest closing it upon merging this PR.)

NOTE: A small test was added to the TestCanvas class to verify the preferred platform change on Linux.

private static Container canvasPanel1, canvasPanel2;
private static Container currentPanel;
private static JTabbedPane tabbedPane;
private static boolean platformX11 = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the new default is "no X11 preference" (EGL on Wayland), starting the example with X11 forced on means it behaves exactly like before on a Wayland session, so the new path only shows up after clicking the menu item. Defaulting to false exercises the new behavior right away:

Suggested change
private static boolean platformX11 = true;
private static boolean platformX11 = false;


// Note: Only for Linux and Wayland platforms, forces you to
// use XWayland (x11) with awt.
settings.setX11PlatformPreferred(platformX11);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note says it "forces" XWayland, but now it's a toggle from the menu and the default is the opposite (EGL on Wayland). Could you reword it so it doesn't mislead someone reading the example?

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work — the platform selection now mirrors the library logic (Wayland + no X11 preference → WaylandGLPlatform, which extends the EGL canvas from the library), and the video-driver string is nicely delegated to the platform classes.

  • The GLX/EGL locking in the render loop (canvas.lock() around deleteContext()/dispose()) looks correct and needed for the EGL path.
  • Two small notes in the TestCanvas example about the default platformX11 value and the now-stale comment.
  • FYI: on the EGL path destroy() is a no-op, so the EGL display is only released via deleteContext()/dispose() on re-init. That's harmless at app shutdown, just something to keep in mind if an app restarts canvases repeatedly.

@JNightRider
JNightRider marked this pull request as draft September 29, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants