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 empty page added when showing OOB dialog #4849

Merged
merged 3 commits into from
Oct 1, 2023

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Sep 30, 2023

Description

This is a fun kind-of-but-not-really concurrency problem. The dialog is shown by using QDialog::exec, which creates an additional event-loop. This event-loop will handle the dialog events. One event happens when the dialog is activated/shown, which deactivates the last active window. Since the window is created before the dialog is shown, it gets deactivated. Deactivating the main window will cause Window::event to be called, which adds a page, since there are no pages at that point.

Technically, the fix could also move the window creation, but the handler for QEvent::WindowDeactivate doesn't need to call getOrAddSelectedPage in the first place.

Fixes #3571.

@pajlada pajlada enabled auto-merge (squash) October 1, 2023 05:59
@pajlada pajlada merged commit 2fc7fdd into Chatterino:master Oct 1, 2023
17 checks passed
@Nerixyz Nerixyz deleted the fix/empty-page-on-oob branch October 1, 2023 07:15
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.

The notification about window being out of bounds creates a new tab when either option is chosen
3 participants