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
Fullscreen leaves zombie window open on macOS #1581
Comments
@JonnyPtn Looking through old posts to SFML forums voicing the same concerns as you, As for your code, a simple work-around would be to use #include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(1280, 720), "Minimal, complete and verifiable example");
window.setFramerateLimit(60);
static bool fullscreen = true;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
if (event.type == sf::Event::KeyPressed)
{
window.create(fullscreen ? sf::VideoMode::getFullscreenModes()[0] : sf::VideoMode(1280, 720), "Non-zombie window");
fullscreen = !fullscreen;
}
}
window.clear();
window.display();
}
} Also: Your EnvironmentOSX Big Sur When running your code, I receive the following message:
|
If this wasn't fixed by the mentioned PR, feel free to reopen the issue. As said, I can't reproduce it. |
Subject of the issue
on macOS if you make a window fullscreen then go back to windowed, there will be a zombie window left open with nothing rendered to it
Your environment
Steps to reproduce
Simply make the window fullscreen then windowed again
Expected behavior
There should only ever be one window
Actual behavior
After returning from fullscreen to windowed, there is a zombie window left behind
Notes
The zombie window seems to have the size/title of the window before going fullscreen (i.e. in the example code above it will have the original title from when it was created, not the new one)
This doesn't seem to be cumulative, i.e. if I continue to toggle full screen it won't create further windows
I tested just recreating the window without going fullscreen, and there is no issue, so it is somehow related to going fullscreen
The text was updated successfully, but these errors were encountered: