feat: lwjglx-awt library update (lwjgl3) - v0.2.5 - #2980
JNightRider wants to merge 3 commits into
Conversation
| private static Container canvasPanel1, canvasPanel2; | ||
| private static Container currentPanel; | ||
| private static JTabbedPane tabbedPane; | ||
| private static boolean platformX11 = true; |
There was a problem hiding this comment.
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:
| 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); |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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()arounddeleteContext()/dispose()) looks correct and needed for the EGL path. - Two small notes in the
TestCanvasexample about the defaultplatformX11value and the now-stale comment. - FYI: on the EGL path
destroy()is a no-op, so the EGL display is only released viadeleteContext()/dispose()on re-init. That's harmless at app shutdown, just something to keep in mind if an app restarts canvases repeatedly.
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.