diff --git a/docs/changelog.rst b/docs/changelog.rst index 8ce33c635..481c33d6d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,9 @@ To update |kitty|, :doc:`follow the instructions `. - Linux: Workaround for broken Nvidia drivers for old cards (:iss:`456`) +- Wayland: Fix kitty being killed on some Wayland compositors if a hidden window + has a lot of output (:iss:`2329`) + 0.17.4 [2020-05-09] -------------------- diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index e88b042b4..0a872bb68 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -632,7 +632,13 @@ draw_resizing_text(OSWindow *w) { static inline bool no_render_frame_received_recently(OSWindow *w, monotonic_t now, monotonic_t max_wait) { bool ans = now - w->last_render_frame_received_at > max_wait; - if (ans && global_state.debug_rendering) log_error("No render frame received in %.2f seconds, re-requesting at: %f", monotonic_t_to_s_double(max_wait), monotonic_t_to_s_double(now)); + if (ans && global_state.debug_rendering) { + if (global_state.is_wayland) { + log_error("No render frame received in %.2f seconds", monotonic_t_to_s_double(max_wait)); + } else { + log_error("No render frame received in %.2f seconds, re-requesting at: %f", monotonic_t_to_s_double(max_wait), monotonic_t_to_s_double(now)); + } + } return ans; } diff --git a/kitty/glfw.c b/kitty/glfw.c index 2eb1e659e..b73f0da04 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -1109,8 +1109,12 @@ wayland_frame_request_callback(id_type os_window_id) { void request_frame_render(OSWindow *w) { - glfwRequestWaylandFrameEvent(w->handle, w->id, wayland_frame_request_callback); - w->render_state = RENDER_FRAME_REQUESTED; + // Some Wayland compositors are too fragile to handle multiple + // render frame requests, see https://github.com/kovidgoyal/kitty/issues/2329 + if (w->render_state != RENDER_FRAME_REQUESTED) { + glfwRequestWaylandFrameEvent(w->handle, w->id, wayland_frame_request_callback); + w->render_state = RENDER_FRAME_REQUESTED; + } } void