Wayland: Fix kitty being killed on some Wayland compositors if a hidden window has a lot of output
Sway falls over and dies if it receives many render frame requests. So send only a single one per damaged window and hope and pray that the compositor hasn't dropped it. Shrug, Wayland, no surprise. Fixes #2329
This commit is contained in:
@@ -22,6 +22,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
|
|
||||||
- Linux: Workaround for broken Nvidia drivers for old cards (:iss:`456`)
|
- 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]
|
0.17.4 [2020-05-09]
|
||||||
--------------------
|
--------------------
|
||||||
|
|||||||
@@ -632,7 +632,13 @@ draw_resizing_text(OSWindow *w) {
|
|||||||
static inline bool
|
static inline bool
|
||||||
no_render_frame_received_recently(OSWindow *w, monotonic_t now, monotonic_t max_wait) {
|
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;
|
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;
|
return ans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1109,8 +1109,12 @@ wayland_frame_request_callback(id_type os_window_id) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
request_frame_render(OSWindow *w) {
|
request_frame_render(OSWindow *w) {
|
||||||
glfwRequestWaylandFrameEvent(w->handle, w->id, wayland_frame_request_callback);
|
// Some Wayland compositors are too fragile to handle multiple
|
||||||
w->render_state = RENDER_FRAME_REQUESTED;
|
// 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
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user