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 5211 - Window is not resizable on wayland
Summary: Window is not resizable on wayland
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-20 23:29 UTC by Deve
Modified: 2020-06-20 23:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deve 2020-06-20 23:29:47 UTC
May be related to https://bugzilla.libsdl.org/show_bug.cgi?id=4859 because as I see you already started working on a patch.

In SDL_Video.c file there is

        if ((want != have) && (_this->SetWindowResizable)) {
            if (want) {
                window->flags |= SDL_WINDOW_RESIZABLE;
            } else {
                window->flags &= ~SDL_WINDOW_RESIZABLE;
            }
            _this->SetWindowResizable(_this, window, (SDL_bool) want);
        }

so that SDL_WINDOW_RESIZABLE flag is set only if there is _this->SetWindowResizable. 

Currently Wayland backend doesn't have this function defined. I made a simple fix:

        if ((want != have)) {
            if (want) {
                window->flags |= SDL_WINDOW_RESIZABLE;
            } else {
                window->flags &= ~SDL_WINDOW_RESIZABLE;
            }
            (_this->SetWindowResizable)
                _this->SetWindowResizable(_this, window, (SDL_bool) want);
        }

and resizing works fine for me on KDE and also on Gnome after I set the hittest function. I'm not sure if/how it affects other backends though.

Or in worst case maybe just create empty SetWindowResizable function for wayland backend to make sure it doesn't break anything else?