Avoid pointlessly querying window pos on Wayland

This commit is contained in:
Kovid Goyal 2024-04-12 10:22:43 +05:30
parent 655494f37b
commit e0374ee623
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -831,7 +831,7 @@ static bool
do_toggle_fullscreen(OSWindow *w, unsigned int flags, bool restore_sizes) {
int width, height, x, y;
glfwGetWindowSize(w->handle, &width, &height);
glfwGetWindowPos(w->handle, &x, &y);
if (!global_state.is_wayland) glfwGetWindowPos(w->handle, &x, &y);
bool was_maximized = glfwGetWindowAttrib(w->handle, GLFW_MAXIMIZED);
if (glfwToggleFullscreen(w->handle, flags)) {
w->before_fullscreen.is_set = true;
@ -841,7 +841,7 @@ do_toggle_fullscreen(OSWindow *w, unsigned int flags, bool restore_sizes) {
}
if (w->before_fullscreen.is_set && restore_sizes) {
glfwSetWindowSize(w->handle, w->before_fullscreen.w, w->before_fullscreen.h);
glfwSetWindowPos(w->handle, w->before_fullscreen.x, w->before_fullscreen.y);
if (!global_state.is_wayland) glfwSetWindowPos(w->handle, w->before_fullscreen.x, w->before_fullscreen.y);
if (w->before_fullscreen.was_maximized) glfwMaximizeWindow(w->handle);
}
return false;