Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x11 doesn't respect earlier resize requests when leaving fullscreen. #5055

Closed
icculus opened this issue Dec 2, 2021 · 3 comments
Closed
Assignees
Milestone

Comments

@icculus
Copy link
Collaborator

icculus commented Dec 2, 2021

This appears to be an SDL2 bug...this code:

https://github.com/libsdl-org/sdl12-compat/blob/4e4527a123fb99a1677055d89c5fc74323ddc4d8/src/SDL12_compat.c#L5074-L5075

If I add a copy/paste of the SDL_SetWindowSize() call after the SDL_SetWindowFullscreen() call, then it works correctly, like the X11 SDL2 backend failed to respect the window size change that happened before leaving fullscreen.

Originally posted by @icculus in libsdl-org/sdl12-compat#148 (comment)

@icculus
Copy link
Collaborator Author

icculus commented Dec 2, 2021

I think this is an SDL2 bug; I'll write up a simple reproduction case soon to verify.

@icculus
Copy link
Collaborator Author

icculus commented Mar 18, 2022

I need to check if this is an SDL issue (maybe it ignores/loses size change requests while fullscreen), or an X11 async issue.

@icculus
Copy link
Collaborator Author

icculus commented Mar 31, 2022

I can't reproduce with this program:

#include "SDL.h"

int main(int argc, char** argv)
{
    SDL_Init(SDL_INIT_VIDEO);
    SDL_Window* win = SDL_CreateWindow("test", 0, 0, 1024, 768, SDL_WINDOW_FULLSCREEN);
    SDL_Event e;

    int done = 0;
    while (!done) {
        while (SDL_PollEvent(&e)) {
            if ((e.type == SDL_KEYDOWN) && (e.key.keysym.sym == SDLK_f)) {
                SDL_SetWindowSize(win, 320, 240);
                SDL_SetWindowFullscreen(win, 0);
            } else if (e.type == SDL_QUIT) {
                done = 1;
                break;
            }
        }
        SDL_Delay(100);
    }

    SDL_DestroyWindow(win);
    SDL_Quit();
    return 0;
}

I can't reproduce with SDL 2.0.16 through 2.0.20 either, using FULLSCREEN or FULLSCREEN_DESKTOP.

I've upgraded this machine to a newer Ubuntu install since then, so it's possible that it was fixed in a later x.org or Gnome (or it is an IceWM bug, which I was often using on the old install due to an unrelated Gnome bug).

So I'm going to call this okay until someone else complains.

@icculus icculus closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant