Ensure reActivateWindow is used only on X11

This commit is contained in:
Ilya Fedin 2022-06-16 11:13:33 +04:00 committed by John Preston
parent 0fc687953f
commit d353e11077
1 changed files with 4 additions and 2 deletions

View File

@ -914,7 +914,10 @@ bool MainWindow::minimizeToTray() {
} }
void MainWindow::reActivateWindow() { void MainWindow::reActivateWindow() {
#if defined Q_OS_UNIX && !defined Q_OS_MAC // X11 is the only platform with unreliable activate requests
if (!Platform::IsX11()) {
return;
}
const auto weak = Ui::MakeWeak(this); const auto weak = Ui::MakeWeak(this);
const auto reActivate = [=] { const auto reActivate = [=] {
if (const auto w = weak.data()) { if (const auto w = weak.data()) {
@ -930,7 +933,6 @@ void MainWindow::reActivateWindow() {
}; };
crl::on_main(this, reActivate); crl::on_main(this, reActivate);
base::call_delayed(200, this, reActivate); base::call_delayed(200, this, reActivate);
#endif // Q_OS_UNIX && !Q_OS_MAC
} }
void MainWindow::showRightColumn(object_ptr<TWidget> widget) { void MainWindow::showRightColumn(object_ptr<TWidget> widget) {