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

Make alert messages application modal and not window modal #8280

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no
Common::MsgType style)
{
std::optional<bool> r = RunOnObject(QApplication::instance(), [&] {
ModalMessageBox message_box(QApplication::activeWindow());
ModalMessageBox message_box(QApplication::activeWindow(), Qt::ApplicationModal);
message_box.setWindowTitle(QString::fromUtf8(caption));
message_box.setText(QString::fromUtf8(text));

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinQt/QtUtils/ModalMessageBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include <QApplication>

ModalMessageBox::ModalMessageBox(QWidget* parent)
ModalMessageBox::ModalMessageBox(QWidget* parent, Qt::WindowModality modality)
: QMessageBox(parent != nullptr ? parent->window() : nullptr)
{
setWindowModality(Qt::WindowModal);
setWindowModality(modality);
setWindowFlags(Qt::Sheet | Qt::WindowTitleHint | Qt::CustomizeWindowHint);

// No parent is still preferable to showing a hidden parent here.
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt/QtUtils/ModalMessageBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class ModalMessageBox : public QMessageBox
{
public:
explicit ModalMessageBox(QWidget* parent);
explicit ModalMessageBox(QWidget* parent, Qt::WindowModality modality = Qt::WindowModal);

static int critical(QWidget* parent, const QString& title, const QString& text,
StandardButtons buttons = Ok, StandardButton default_button = NoButton);
Expand Down