We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5498

Summary: [Patch] Implement Wayland_SetWindowResizable
Product: SDL Reporter: Ethan Lee <flibitijibibo>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: cameron.gutman
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Implement Wayland_SetWindowResizable
Implement Wayland_SetWindowResizable

Description Ethan Lee 2021-01-23 20:05:06 UTC
Created attachment 4695 [details]
Implement Wayland_SetWindowResizable

Attached is a patch to add support for SDL_SetWindowResizable on Wayland.

Thankfully, all of the real work is implemented in the window callbacks - the callbacks just check for the RESIZABLE flag, and either ignore/react to window events accordingly.
Comment 1 Cameron Gutman 2021-01-23 20:38:58 UTC
>      device->SetWindowBordered = Wayland_SetWindowBordered;
> +    device->SetWindowBordered = Wayland_SetWindowResizable;

I assume you meant SetWindowResizable here.
Comment 2 Ethan Lee 2021-01-23 20:41:34 UTC
Created attachment 4696 [details]
Implement Wayland_SetWindowResizable

Yup, my mistake - what I get for cleaning up test patches with copypasting.
Comment 3 Cameron Gutman 2021-01-23 20:58:53 UTC
Nice! This (predictably) fixes my window not being resizable on Wayland. I was just going to try to track that down today. Using GNOME's Super+Left/Right/Up/Down hotkeys would just lead to the window flying around but not actually changing size. With this patch, it works just fine :)

I had seen the code handling SDL_WINDOW_RESIZABLE in the Wayland backend, but it never occurred to me that we might not actually be able to set SDL_WINDOW_RESIZABLE on our window because of a missing SetWindowResizable() implementation.
Comment 4 Sam Lantinga 2021-01-23 21:18:07 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/506c8c15349a