SDL: wayland: Set the EGL swap timeout to one second from the current time

From d5b5e524af010d51437470255d5ac848996eeabd Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Sun, 12 Mar 2023 17:02:18 -0400
Subject: [PATCH] wayland: Set the EGL swap timeout to one second from the
 current time

Set the timeout max to one second from the current time or presentation time will always be greater than the timeout and the application will run unthrottled.
---
 src/video/wayland/SDL_waylandopengles.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/video/wayland/SDL_waylandopengles.c b/src/video/wayland/SDL_waylandopengles.c
index eead262aa951..3dec3e32b490 100644
--- a/src/video/wayland/SDL_waylandopengles.c
+++ b/src/video/wayland/SDL_waylandopengles.c
@@ -125,7 +125,7 @@ int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
         SDL_VideoData *videodata = _this->driverdata;
         struct wl_display *display = videodata->display;
         /* 1 sec, so we'll progress even if throttled to zero. */
-        const Uint64 max_wait = SDL_NS_PER_SECOND;
+        const Uint64 max_wait = SDL_GetTicksNS() + SDL_NS_PER_SECOND;
         while (SDL_AtomicGet(&data->swap_interval_ready) == 0) {
             Uint64 now;