diff --git a/docs/changelog.rst b/docs/changelog.rst index ce9aa4bf0..0b51c5dda 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -50,6 +50,8 @@ To update |kitty|, :doc:`follow the instructions `. - macOS: Add a number of common macOS keyboard shortcuts +- macOS: Reduce energy consumption by not rendering occluded windows + - Fix scrollback pager history not being cleared when clearing the main scrollback buffer (:iss:`1387`) diff --git a/kitty/glfw.c b/kitty/glfw.c index f5c87c908..eda64acbd 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -869,9 +869,11 @@ mark_os_window_for_close(OSWindow* w, bool yes) { bool should_os_window_be_rendered(OSWindow* w) { - if (glfwGetWindowAttrib(w->handle, GLFW_ICONIFIED)) return false; - if (!glfwGetWindowAttrib(w->handle, GLFW_VISIBLE)) return false; - return true; + return ( + glfwGetWindowAttrib(w->handle, GLFW_ICONIFIED) || + !glfwGetWindowAttrib(w->handle, GLFW_VISIBLE) || + glfwGetWindowAttrib(w->handle, GLFW_OCCLUDED) + ) ? false : true; } bool