SDL: wayland: Adjust overlap required for popups to be considered adjacent

From 17fba24e218a08008e5fb5bed0724d37ffef536a Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Tue, 2 May 2023 21:09:30 -0400
Subject: [PATCH] wayland: Adjust overlap required for popups to be considered
 adjacent

Popups beyond the right and bottom borders of the window must be width/height minus one in order to be considered adjacent and not be instantly closed or cause a protocol error.
---
 src/video/wayland/SDL_waylandwindow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index ff32539a7ef3..cbd09c88eed2 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -317,10 +317,10 @@ static void EnsurePopupPositionIsValid(SDL_Window *window)
         window->y = -window->h;
     }
     if (window->x > window->parent->w) {
-        window->x = window->parent->w;
+        window->x = window->parent->w - 1;
     }
     if (window->y > window->parent->h) {
-        window->y = window->parent->h;
+        window->y = window->parent->h - 1;
     }
 }