Skip to content

Commit

Permalink
fix: fix windowed fullscreen overlapping taskbar on Windows (#5243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaled-Dridi committed May 7, 2024
1 parent 072d207 commit 81b53f4
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,18 @@ 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);
// 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,
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;
Expand Down

0 comments on commit 81b53f4

Please sign in to comment.