From a25c93b28e7c50b545d13937928eeb1ddd639cef Mon Sep 17 00:00:00 2001 From: Quantum Date: Tue, 3 Aug 2021 00:11:34 -0400 Subject: [PATCH] [client] wayland: document wlroots viewport handling workaround Add a comment so we don't forget and remove the "useless" code. --- client/displayservers/Wayland/gl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/displayservers/Wayland/gl.c b/client/displayservers/Wayland/gl.c index c46d05c2..f5fad8bf 100644 --- a/client/displayservers/Wayland/gl.c +++ b/client/displayservers/Wayland/gl.c @@ -103,9 +103,13 @@ void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct { if (wlWm.viewport) { + // Clearing the source and destination rectangles should happen in wp_viewport_destroy. + // However, wlroots does not clear the rectangle until fixed in 456c6e22 (2021-08-02). + // This should be kept to work around old versions of wlroots. wl_fixed_t clear = wl_fixed_from_int(-1); wp_viewport_set_source(wlWm.viewport, clear, clear, clear, clear); wp_viewport_set_destination(wlWm.viewport, -1, -1); + wp_viewport_destroy(wlWm.viewport); wlWm.viewport = NULL; }