From e0374ee62393c28c6a82108b75a7f0ce4e4e47fd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 12 Apr 2024 10:22:43 +0530 Subject: [PATCH] Avoid pointlessly querying window pos on Wayland --- kitty/glfw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/glfw.c b/kitty/glfw.c index bab1597b4..c9550833b 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -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;