Commit e787282ba8021388d955a7481027beee46ea4f65

Ethan Lee 2021-01-23T15:40:22

Implement Wayland_SetWindowResizable

diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index addd006..61034f4 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -203,6 +203,7 @@ Wayland_CreateDevice(int devindex)
     device->SetWindowGrab = Wayland_SetWindowGrab;
     device->RestoreWindow = Wayland_RestoreWindow;
     device->SetWindowBordered = Wayland_SetWindowBordered;
+    device->SetWindowResizable = Wayland_SetWindowResizable;
     device->SetWindowSize = Wayland_SetWindowSize;
     device->SetWindowTitle = Wayland_SetWindowTitle;
     device->DestroyWindow = Wayland_DestroyWindow;
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 9f9cf6c..16c6fa6 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -628,6 +628,16 @@ Wayland_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
 }
 
 void
+Wayland_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable)
+{
+    /* No-op, this is handled by the xdg-shell/wl_shell callbacks.
+     * Also note that we do NOT implement SetMaximumSize/SetMinimumSize, as
+     * those are also no-ops for the same reason, but SDL_video.c does not
+     * require a driver implementation.
+     */
+}
+
+void
 Wayland_MaximizeWindow(_THIS, SDL_Window * window)
 {
     SDL_WindowData *wind = window->driverdata;
diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h
index 88a9768..4753cae 100644
--- a/src/video/wayland/SDL_waylandwindow.h
+++ b/src/video/wayland/SDL_waylandwindow.h
@@ -94,6 +94,7 @@ extern void Wayland_MinimizeWindow(_THIS, SDL_Window * window);
 extern void Wayland_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
 extern void Wayland_RestoreWindow(_THIS, SDL_Window * window);
 extern void Wayland_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
+extern void Wayland_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable);
 extern int Wayland_CreateWindow(_THIS, SDL_Window *window);
 extern void Wayland_SetWindowSize(_THIS, SDL_Window * window);
 extern void Wayland_SetWindowTitle(_THIS, SDL_Window * window);