Skip to content

Commit 1ff204b

Browse files
committed
fix: add 'isWaylandSession'
1 parent 52751c9 commit 1ff204b

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

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

Lines changed: 16 additions & 8 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);
@@ -317,7 +317,15 @@ public String getBuildInfo() {
317317
sb.append(" * Build Date: ").append(JmeVersion.BUILD_DATE);
318318
return sb.toString();
319319
}
320-
320+
321+
public boolean isWaylandSession() {
322+
// The following matches the test GLFW does to enable the Wayland backend.
323+
if ("wayland".equalsIgnoreCase(System.getenv("XDG_SESSION_TYPE")) && System.getenv("WAYLAND_DISPLAY") != null) {
324+
return true;
325+
}
326+
return false;
327+
}
328+
321329
public abstract URL getPlatformAssetConfigURL();
322330

323331
public abstract JmeContext newContext(AppSettings settings, JmeContext.Type contextType);

0 commit comments

Comments
 (0)