|
@@ -47,6 +47,33 @@ handle_configure(void *data, struct wl_shell_surface *shell_surface,
|
|
|
SDL_Window *window = wind->sdlwindow;
|
|
|
struct wl_region *region;
|
|
|
|
|
|
+ /* wl_shell_surface spec states that this is a suggestion.
|
|
|
+ Ignore if less than or greater than max/min size. */
|
|
|
+
|
|
|
+ if (width == 0 || height == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
|
|
|
+ if ((window->flags & SDL_WINDOW_RESIZABLE)) {
|
|
|
+ if (window->max_w > 0) {
|
|
|
+ width = SDL_min(width, window->max_w);
|
|
|
+ }
|
|
|
+ width = SDL_max(width, window->min_w);
|
|
|
+
|
|
|
+ if (window->max_h > 0) {
|
|
|
+ height = SDL_min(height, window->max_h);
|
|
|
+ }
|
|
|
+ height = SDL_max(height, window->min_h);
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (width == window->w && height == window->h) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
window->w = width;
|
|
|
window->h = height;
|
|
|
WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
|
|
@@ -146,6 +173,26 @@ Wayland_SetWindowFullscreen(_THIS, SDL_Window * window,
|
|
|
WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
|
|
|
}
|
|
|
|
|
|
+void
|
|
|
+Wayland_RestoreWindow(_THIS, SDL_Window * window)
|
|
|
+{
|
|
|
+ SDL_WindowData *wind = window->driverdata;
|
|
|
+
|
|
|
+ wl_shell_surface_set_toplevel(wind->shell_surface);
|
|
|
+
|
|
|
+ WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
|
|
|
+}
|
|
|
+
|
|
|
+void
|
|
|
+Wayland_MaximizeWindow(_THIS, SDL_Window * window)
|
|
|
+{
|
|
|
+ SDL_WindowData *wind = window->driverdata;
|
|
|
+
|
|
|
+ wl_shell_surface_set_maximized(wind->shell_surface, NULL);
|
|
|
+
|
|
|
+ WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
|
|
|
+}
|
|
|
+
|
|
|
int Wayland_CreateWindow(_THIS, SDL_Window *window)
|
|
|
{
|
|
|
SDL_WindowData *data;
|
|
@@ -239,6 +286,17 @@ void Wayland_SetWindowSize(_THIS, SDL_Window * window)
|
|
|
wl_region_destroy(region);
|
|
|
}
|
|
|
|
|
|
+void Wayland_SetWindowTitle(_THIS, SDL_Window * window)
|
|
|
+{
|
|
|
+ SDL_WindowData *wind = window->driverdata;
|
|
|
+
|
|
|
+ if (window->title != NULL) {
|
|
|
+ wl_shell_surface_set_title(wind->shell_surface, window->title);
|
|
|
+ }
|
|
|
+
|
|
|
+ WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
|
|
|
+}
|
|
|
+
|
|
|
void Wayland_DestroyWindow(_THIS, SDL_Window *window)
|
|
|
{
|
|
|
SDL_VideoData *data = _this->driverdata;
|