2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 14:17:45 +00:00

Support confirm-on-Quit on macOS.

This commit is contained in:
John Preston
2022-01-26 14:50:10 +03:00
parent 6a3ad52aef
commit b8f1cebeb6
2 changed files with 6 additions and 1 deletions

View File

@@ -261,7 +261,11 @@ void Sandbox::setupScreenScale() {
Sandbox::~Sandbox() = default;
bool Sandbox::event(QEvent *e) {
if (e->type() == QEvent::Close || e->type() == QEvent::Quit) {
if (e->type() == QEvent::Quit && !App::quitting()) {
App::quit();
e->ignore();
return false;
} else if (e->type() == QEvent::Close) {
App::quit();
}
return QApplication::event(e);

View File

@@ -393,6 +393,7 @@ void Session::uploadsStopWithConfirmation(Fn<void()> done) {
}
});
window->show(std::move(box));
window->activate();
}
void Session::uploadsStop() {