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 - [Patch] Implement Wayland_SetWindowResizable
Summary: [Patch] Implement Wayland_SetWindowResizable
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-23 20:05 UTC by Ethan Lee
Modified: 2021-01-23 21:18 UTC (History)
1 user (show)

See Also:


Attachments
Implement Wayland_SetWindowResizable (2.32 KB, patch)
2021-01-23 20:05 UTC, Ethan Lee
Details | Diff
Implement Wayland_SetWindowResizable (2.32 KB, patch)
2021-01-23 20:41 UTC, Ethan Lee
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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