Skip to content

Commit dff852d

Browse files
committed
fix: add 'isWaylandSession'|SystemDelegate
1 parent e6305bd commit dff852d

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ public boolean isDeviceRumbleSupported() {
159159
return false;
160160
}
161161

162-
@Override
163-
public void rumble(float amountHigh, float amountLow, float duration) {
164-
}
165-
166-
public final AssetManager newAssetManager(URL configFile) {
167-
return new DesktopAssetManager(configFile);
168-
}
162+
@Override
163+
public void rumble(float amountHigh, float amountLow, float duration) {
164+
}
165+
166+
public final AssetManager newAssetManager(URL configFile) {
167+
return new DesktopAssetManager(configFile);
168+
}
169169

170170
public final AssetManager newAssetManager() {
171171
return new DesktopAssetManager(null);
@@ -309,6 +309,14 @@ public Platform getPlatform() {
309309
}
310310
}
311311

312+
public boolean isWaylandSession() {
313+
// The following matches the test GLFW does to enable the Wayland backend.
314+
if ("wayland".equalsIgnoreCase(System.getenv("XDG_SESSION_TYPE")) && System.getenv("WAYLAND_DISPLAY") != null) {
315+
return true;
316+
}
317+
return false;
318+
}
319+
312320
public String getBuildInfo() {
313321
StringBuilder sb = new StringBuilder();
314322
sb.append("Running on ").append(getFullName()).append("\n");

0 commit comments

Comments
 (0)