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

fix: ignore save requests after closing all windows #5081

Merged
merged 3 commits into from Jan 14, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jan 13, 2024

Fixes #1098. WindowManager::save is called two times when closing all windows:

  1. When closing a main window:
    void Window::closeEvent(QCloseEvent *)
    {
    if (this->type_ == WindowType::Main)
    {
    auto app = getApp();
    app->windows->save();
    app->windows->closeAll();
    }
  2. When saving all singletons:
    void Application::save()
    {
    for (auto &singleton : this->singletons_)
    {
    singleton->save();
    }
    }

The second save doesn't see the closed child windows if all windows were closed with closeAll. So after closeAll is called, the window manager will now ignore all save events.

@pajlada pajlada enabled auto-merge (squash) January 14, 2024 12:09
@pajlada pajlada merged commit 292f9b9 into Chatterino:master Jan 14, 2024
20 checks passed
@Nerixyz Nerixyz deleted the fix/late-window-save branch January 14, 2024 12:37
devJimmyboy pushed a commit to devJimmyboy/chatterino7 that referenced this pull request Feb 11, 2024
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

Successfully merging this pull request may close these issues.

Can't have multiple windows in window layout without losing one of them on exit
2 participants