SDL: wayland: Always use the entire buffer for the viewport source (4c3e5)

From 4c3e5cf1d17414ecbe6ccf230323503e7ed4b2cb Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Sun, 17 Mar 2024 10:42:06 -0400
Subject: [PATCH] wayland: Always use the entire buffer for the viewport source

Not doing so can result in protocol errors if the viewport source region is updated and a buffer with the old, smaller dimensions is committed.

(cherry picked from commit 24aedc1439e1ee894d9cd2a7217e48635c0c6593)
---
 src/video/wayland/SDL_waylandwindow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 483ec1926c6c5..34008d5e7af36 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -202,7 +202,7 @@ static void SetDrawSurfaceViewport(SDL_Window *window, int src_width, int src_he
             wind->draw_viewport = wp_viewporter_get_viewport(video->viewporter, wind->surface);
         }
 
-        wp_viewport_set_source(wind->draw_viewport, wl_fixed_from_int(0), wl_fixed_from_int(0), wl_fixed_from_int(src_width), wl_fixed_from_int(src_height));
+        wp_viewport_set_source(wind->draw_viewport, wl_fixed_from_int(-1), wl_fixed_from_int(-1), wl_fixed_from_int(-1), wl_fixed_from_int(-1));
         wp_viewport_set_destination(wind->draw_viewport, dst_width, dst_height);
     }
 }