Skip to content

Commit a83d721

Browse files
committed
update to latest libgdx
1 parent 492e8e9 commit a83d721

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
.idea/
33
/build/
4+
/dstBuild/
45
.gradle/
56
h2d-libgdx-spine-extension/build/
67
hyperlap2d-common-api/build/

src/main/java/com/badlogic/gdx/backends/lwjgl3/Lwjgl3ApplicationGLESFix.java

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -532,27 +532,29 @@ static long createGlfwWindow (Lwjgl3ApplicationConfiguration config, long shared
532532
Lwjgl3Window.setSizeLimits(windowHandle, config.windowMinWidth, config.windowMinHeight, config.windowMaxWidth,
533533
config.windowMaxHeight);
534534
if (config.fullscreenMode == null) {
535-
if (config.windowX == -1 && config.windowY == -1) {
536-
int windowWidth = Math.max(config.windowWidth, config.windowMinWidth);
537-
int windowHeight = Math.max(config.windowHeight, config.windowMinHeight);
538-
if (config.windowMaxWidth > -1) windowWidth = Math.min(windowWidth, config.windowMaxWidth);
539-
if (config.windowMaxHeight > -1) windowHeight = Math.min(windowHeight, config.windowMaxHeight);
540-
541-
long monitorHandle = GLFW.glfwGetPrimaryMonitor();
542-
if (config.windowMaximized && config.maximizedMonitor != null) {
543-
monitorHandle = config.maximizedMonitor.monitorHandle;
544-
}
535+
if (GLFW.glfwGetPlatform() != GLFW.GLFW_PLATFORM_WAYLAND) {
536+
if (config.windowX == -1 && config.windowY == -1) {
537+
int windowWidth = Math.max(config.windowWidth, config.windowMinWidth);
538+
int windowHeight = Math.max(config.windowHeight, config.windowMinHeight);
539+
if (config.windowMaxWidth > -1) windowWidth = Math.min(windowWidth, config.windowMaxWidth);
540+
if (config.windowMaxHeight > -1) windowHeight = Math.min(windowHeight, config.windowMaxHeight);
541+
542+
long monitorHandle = GLFW.glfwGetPrimaryMonitor();
543+
if (config.windowMaximized && config.maximizedMonitor != null) {
544+
monitorHandle = config.maximizedMonitor.monitorHandle;
545+
}
545546

546-
IntBuffer areaXPos = BufferUtils.createIntBuffer(1);
547-
IntBuffer areaYPos = BufferUtils.createIntBuffer(1);
548-
IntBuffer areaWidth = BufferUtils.createIntBuffer(1);
549-
IntBuffer areaHeight = BufferUtils.createIntBuffer(1);
550-
GLFW.glfwGetMonitorWorkarea(monitorHandle, areaXPos, areaYPos, areaWidth, areaHeight);
547+
IntBuffer areaXPos = BufferUtils.createIntBuffer(1);
548+
IntBuffer areaYPos = BufferUtils.createIntBuffer(1);
549+
IntBuffer areaWidth = BufferUtils.createIntBuffer(1);
550+
IntBuffer areaHeight = BufferUtils.createIntBuffer(1);
551+
GLFW.glfwGetMonitorWorkarea(monitorHandle, areaXPos, areaYPos, areaWidth, areaHeight);
551552

552-
GLFW.glfwSetWindowPos(windowHandle, Math.max(0, areaXPos.get(0) + areaWidth.get(0) / 2 - windowWidth / 2),
553-
Math.max(0, areaYPos.get(0) + areaHeight.get(0) / 2 - windowHeight / 2));
554-
} else {
555-
GLFW.glfwSetWindowPos(windowHandle, config.windowX, config.windowY);
553+
GLFW.glfwSetWindowPos(windowHandle, Math.max(0, areaXPos.get(0) + areaWidth.get(0) / 2 - windowWidth / 2),
554+
Math.max(0, areaYPos.get(0) + areaHeight.get(0) / 2 - windowHeight / 2));
555+
} else {
556+
GLFW.glfwSetWindowPos(windowHandle, config.windowX, config.windowY);
557+
}
556558
}
557559

558560
if (config.windowMaximized) {

0 commit comments

Comments
 (0)