From 0de4a2160a83f4df98e03d347d69f715f04f3603 Mon Sep 17 00:00:00 2001 From: kornes <28986062+kornes@users.noreply.github.com> Date: Sat, 16 Apr 2022 08:59:20 +0000 Subject: [PATCH] Add missing parent pointer to few QMessageBox and QFontDialog (#3679) Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> Co-authored-by: pajlada --- CHANGELOG.md | 1 + src/widgets/Notebook.cpp | 2 +- src/widgets/settingspages/FiltersPage.cpp | 2 +- src/widgets/settingspages/GeneralPage.cpp | 4 +--- src/widgets/splits/Split.cpp | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0031dfc4..9384836e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Minor: Fixed being unable to load Twitch Usercards from the `/mentions` tab. (#3623) - Minor: Add information about the user's operating system in the About page. (#3663) - Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646) +- Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679) - Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662) ## 2.3.5 diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp index 959b277bc..f7c9ad414 100644 --- a/src/widgets/Notebook.cpp +++ b/src/widgets/Notebook.cpp @@ -368,7 +368,7 @@ void Notebook::setShowTabs(bool value) // show a popup upon hiding tabs if (!value && getSettings()->informOnTabVisibilityToggle.getValue()) { - QMessageBox msgBox; + QMessageBox msgBox(this->window()); msgBox.window()->setWindowTitle("Chatterino - hidden tabs"); msgBox.setText("You've just hidden your tabs."); msgBox.setInformativeText( diff --git a/src/widgets/settingspages/FiltersPage.cpp b/src/widgets/settingspages/FiltersPage.cpp index b5282db82..245fc8fd8 100644 --- a/src/widgets/settingspages/FiltersPage.cpp +++ b/src/widgets/settingspages/FiltersPage.cpp @@ -88,7 +88,7 @@ void FiltersPage::tableCellClicked(const QModelIndex &clicked, // valid column if (clicked.column() == 2) { - QMessageBox popup; + QMessageBox popup(this->window()); filterparser::FilterParser f( view->getModel()->data(clicked.siblingAtColumn(1)).toString()); diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index 9cd6bc4b1..8895ccd24 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -735,10 +735,8 @@ QString GeneralPage::getFont(const DropdownArgs &args) const args.combobox->setEditText("Choosing..."); QFontDialog dialog(getApp()->fonts->getFont(FontStyle::ChatMedium, 1.)); - dialog.setWindowFlag(Qt::WindowStaysOnTopHint); - auto ok = bool(); - auto font = dialog.getFont(&ok); + auto font = dialog.getFont(&ok, this->window()); if (ok) return font.family(); diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 5b6b1ff41..f22a36e66 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -219,7 +219,7 @@ Split::Split(QWidget *parent) if (getSettings()->askOnImageUpload.getValue()) { - QMessageBox msgBox; + QMessageBox msgBox(this->window()); msgBox.setWindowTitle("Chatterino"); msgBox.setText("Image upload"); msgBox.setInformativeText(