From 356407d9b2aaefe1ccf13bbecfd8edc89abb2db0 Mon Sep 17 00:00:00 2001 From: Khaled-Dridi Date: Sat, 4 May 2024 13:06:00 +0100 Subject: [PATCH 1/5] Update LwjglDisplayDevice.java --- .../core/subsystem/lwjgl/LwjglDisplayDevice.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java index dda04be1427..65567c64a99 100644 --- a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java +++ b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java @@ -98,6 +98,18 @@ public void setDisplayModeSetting(DisplayModeSetting displayModeSetting, boolean GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE); config.setDisplayModeSetting(displayModeSetting); config.setWindowedFullscreen(true); + ///////////////////////////////////////////// + vidMode = desktopResolution.get(); + GLFW.glfwSetWindowMonitor(window, + MemoryUtil.NULL, + 0, + 0, + vidMode.width(), + vidMode.height(), + GLFW.GLFW_DONT_CARE); + GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE); + config.setDisplayModeSetting(displayModeSetting); + config.setWindowedFullscreen(true); break; case WINDOWED: GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_TRUE); From 1602024869f801a8c43a855aad516c106b5e19de Mon Sep 17 00:00:00 2001 From: Khaled-Dridi Date: Sat, 4 May 2024 13:27:32 +0100 Subject: [PATCH 2/5] Update LwjglDisplayDevice.java --- .../subsystem/lwjgl/LwjglDisplayDevice.java | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java index 65567c64a99..715a5a8b081 100644 --- a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java +++ b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java @@ -78,6 +78,7 @@ public void setDisplayModeSetting(DisplayModeSetting displayModeSetting) { setDisplayModeSetting(displayModeSetting, true); } + @SuppressWarnings({"checkstyle:WhitespaceAround", "checkstyle:WhitespaceAfter"}) public void setDisplayModeSetting(DisplayModeSetting displayModeSetting, boolean resize) { long window = GLFW.glfwGetCurrentContext(); switch (displayModeSetting) { @@ -88,25 +89,15 @@ public void setDisplayModeSetting(DisplayModeSetting displayModeSetting, boolean break; case WINDOWED_FULLSCREEN: GLFWVidMode vidMode = desktopResolution.get(); - GLFW.glfwSetWindowMonitor(window, - MemoryUtil.NULL, - 0, - 0, - vidMode.width(), - vidMode.height(), - GLFW.GLFW_DONT_CARE); - GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE); - config.setDisplayModeSetting(displayModeSetting); - config.setWindowedFullscreen(true); - ///////////////////////////////////////////// - vidMode = desktopResolution.get(); - GLFW.glfwSetWindowMonitor(window, - MemoryUtil.NULL, - 0, - 0, - vidMode.width(), - vidMode.height(), - GLFW.GLFW_DONT_CARE); + for(int i=0;i<2;i++){ + GLFW.glfwSetWindowMonitor(window, + MemoryUtil.NULL, + 0, + 0, + vidMode.width(), + vidMode.height(), + GLFW.GLFW_DONT_CARE); + } GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE); config.setDisplayModeSetting(displayModeSetting); config.setWindowedFullscreen(true); From 94b44a1f31f7467842a0f1ce2a05cb81dfc51173 Mon Sep 17 00:00:00 2001 From: Khaled-Dridi <95275414+Khaled-Dridi@users.noreply.github.com> Date: Sun, 5 May 2024 00:20:34 +0200 Subject: [PATCH 3/5] Update engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java Co-authored-by: BenjaminAmos <24301287+BenjaminAmos@users.noreply.github.com> --- .../engine/core/subsystem/lwjgl/LwjglDisplayDevice.java | 1 - 1 file changed, 1 deletion(-) diff --git a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java index 715a5a8b081..5e5a20e26b6 100644 --- a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java +++ b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java @@ -78,7 +78,6 @@ public void setDisplayModeSetting(DisplayModeSetting displayModeSetting) { setDisplayModeSetting(displayModeSetting, true); } - @SuppressWarnings({"checkstyle:WhitespaceAround", "checkstyle:WhitespaceAfter"}) public void setDisplayModeSetting(DisplayModeSetting displayModeSetting, boolean resize) { long window = GLFW.glfwGetCurrentContext(); switch (displayModeSetting) { From b423437ebd2a37b1023aedf811268188464ab9a6 Mon Sep 17 00:00:00 2001 From: Khaled-Dridi <95275414+Khaled-Dridi@users.noreply.github.com> Date: Sun, 5 May 2024 00:20:55 +0200 Subject: [PATCH 4/5] Update engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java Co-authored-by: BenjaminAmos <24301287+BenjaminAmos@users.noreply.github.com> --- .../engine/core/subsystem/lwjgl/LwjglDisplayDevice.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java index 5e5a20e26b6..56b4078f8eb 100644 --- a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java +++ b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java @@ -88,7 +88,9 @@ public void setDisplayModeSetting(DisplayModeSetting displayModeSetting, boolean break; case WINDOWED_FULLSCREEN: GLFWVidMode vidMode = desktopResolution.get(); - for(int i=0;i<2;i++){ + // Attempt to go into fullscreen twice to fix the taskbar showing on-top of the game on Windows. + // See also: https://github.com/MovingBlocks/Terasology/issues/5228. + for (int i = 0; i < 2; i++) { GLFW.glfwSetWindowMonitor(window, MemoryUtil.NULL, 0, From 56f0fdec81231d9860fcaf44db71fbf1690b236d Mon Sep 17 00:00:00 2001 From: Khaled-Dridi Date: Tue, 7 May 2024 22:38:14 +0100 Subject: [PATCH 5/5] Update LwjglDisplayDevice.java --- .../engine/core/subsystem/lwjgl/LwjglDisplayDevice.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java index 56b4078f8eb..44e8d40cefc 100644 --- a/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java +++ b/engine/src/main/java/org/terasology/engine/core/subsystem/lwjgl/LwjglDisplayDevice.java @@ -98,8 +98,8 @@ public void setDisplayModeSetting(DisplayModeSetting displayModeSetting, boolean vidMode.width(), vidMode.height(), GLFW.GLFW_DONT_CARE); + GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE); } - GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE); config.setDisplayModeSetting(displayModeSetting); config.setWindowedFullscreen(true); break;