GLFW API to check if window is fullscreen

This commit is contained in:
Kovid Goyal
2021-11-11 12:33:12 +05:30
parent b3a9c1a100
commit d95a00df73
7 changed files with 29 additions and 2 deletions

8
glfw/wl_window.c vendored
View File

@@ -413,9 +413,15 @@ static void setFullscreen(_GLFWwindow* window, _GLFWmonitor* monitor, bool on)
setIdleInhibitor(window, on);
}
bool
_glfwPlatformIsFullscreen(_GLFWwindow *window, unsigned int flags UNUSED) {
return window->wl.toplevel_states & TOPLEVEL_STATE_FULLSCREEN;
}
bool
_glfwPlatformToggleFullscreen(_GLFWwindow *window, unsigned int flags UNUSED) {
bool already_fullscreen = window->wl.toplevel_states & TOPLEVEL_STATE_FULLSCREEN;
bool already_fullscreen = _glfwPlatformIsFullscreen(window, flags);
setFullscreen(window, NULL, !already_fullscreen);
return !already_fullscreen;
}