@@ -295,6 +295,7 @@ public final class AppSettings extends HashMap<String, Object> {
295295 defaults .put ("UseRetinaFrameBuffer" , false );
296296 defaults .put ("WindowYPosition" , 0 );
297297 defaults .put ("WindowXPosition" , 0 );
298+ defaults .put ("X11PlatformPreferred" , false );
298299 // defaults.put("Icons", null);
299300 }
300301
@@ -1507,4 +1508,28 @@ public int getDisplay() {
15071508 public void setDisplay (int mon ) {
15081509 putInteger ("Display" , mon );
15091510 }
1511+
1512+ /**
1513+ * Sets the preferred native platform for creating the GL context on Linux distributions.
1514+ * <p>
1515+ * This setting is relevant for Linux distributions or derivatives that utilize a Wayland session alongside an X11 via the XWayland bridge.
1516+ * Enabling this option allows the use of GLX for window positioning and/or icon configuration.
1517+ *
1518+ * @param preferred true to prefer GLX (native X11) for the GL context, false to prefer EGL (native Wayland).
1519+ */
1520+ public void setX11PlatformPreferred (boolean preferred ) {
1521+ putBoolean ("X11PlatformPreferred" , preferred );
1522+ }
1523+
1524+ /**
1525+ * Determines which native platform is preferred for GL context creation on Linux distributions.
1526+ * <p>
1527+ * This setting is only valid on Linux distributions or derivatives that support Wayland,
1528+ * and it indicates whether GLX (native X11) or EGL (native Wayland) is enabled for the GL context.
1529+ *
1530+ * @return true if GLX is preferred, otherwise false if EGL is preferred (native Wayland).
1531+ */
1532+ public boolean isX11PlatformPreferred () {
1533+ return getBoolean ("X11PlatformPreferred" );
1534+ }
15101535}
0 commit comments