mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Support confirm-on-Quit on macOS.
This commit is contained in:
parent
6a3ad52aef
commit
b8f1cebeb6
2 changed files with 6 additions and 1 deletions
|
@ -261,7 +261,11 @@ void Sandbox::setupScreenScale() {
|
||||||
Sandbox::~Sandbox() = default;
|
Sandbox::~Sandbox() = default;
|
||||||
|
|
||||||
bool Sandbox::event(QEvent *e) {
|
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();
|
App::quit();
|
||||||
}
|
}
|
||||||
return QApplication::event(e);
|
return QApplication::event(e);
|
||||||
|
|
|
@ -393,6 +393,7 @@ void Session::uploadsStopWithConfirmation(Fn<void()> done) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
window->show(std::move(box));
|
window->show(std::move(box));
|
||||||
|
window->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::uploadsStop() {
|
void Session::uploadsStop() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue