Skip to content

feat: Unified method for detecting a Wayland session#2848

Open
JNightRider wants to merge 18 commits into
jMonkeyEngine:masterfrom
JNightRider:feature/check-wayland-session
Open

feat: Unified method for detecting a Wayland session#2848
JNightRider wants to merge 18 commits into
jMonkeyEngine:masterfrom
JNightRider:feature/check-wayland-session

Conversation

@JNightRider

Copy link
Copy Markdown
Contributor

Currently, Wayland session detection is duplicated in the JME3 code, which can lead to inconsistencies. Therefore, this pull request introduces a way to detect them using JmeSystem.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request centralizes Wayland session detection by introducing isWaylandSession() in JmeSystem and JmeSystemDelegate, replacing local checks in LwjglCanvas and LwjglWindow, and deprecating the old isWayland() method in LwjglxDefaultGLPlatform. Feedback includes a recommendation to restrict the Wayland check to Linux/FreeBSD platforms and wrap it in a try-catch block to handle potential SecurityExceptions, as well as a minor typo correction in the Javadoc.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java Outdated
Comment thread jme3-core/src/main/java/com/jme3/system/JmeSystem.java Outdated

@riccardobl riccardobl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!
There is something wrong in the diff of this PR, it marks a lot of changes where the code did not change, maybe something to do with whitespaces or a borked rebase. Can you fix that?

@JNightRider JNightRider marked this pull request as draft June 8, 2026 18:13
@JNightRider

JNightRider commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@riccardobl

There is something wrong in the diff of this PR, it marks a lot of changes where the code did not change, maybe something to do with whitespaces or a borked rebase. Can you fix that?

I have no idea. I opened the file and looked for differences (I even edited it with nano), but I didn't find any. When I inspected it with IntelliJ IDEA tools, only the new method was shown. I tried to "fix" it, but it seems I made it worse.

If you agree with the current changes, I will proceed to address Gemini's suggestion... otherwise, someone else can clone these changes and try to add them to the engine.

[ NOTE ]

Incidentally, I generated another branch and it shows the same changes in both affected classes.

In another test where I only changed one character in a comment, it tells me that the entire file has changed... it all seems strange to me.

@riccardobl

riccardobl commented Jun 8, 2026

Copy link
Copy Markdown
Member

Must be some non printable character (or github bug?)
Feel free to go ahead and address the gemini suggestion, i will try to figure out the diff weirdness before merging the pr

@JNightRider JNightRider marked this pull request as ready for review June 8, 2026 20:55
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