diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 17a2561332..ae582e0ad2 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -143,7 +143,7 @@ void MainWindow::createTrayIconMenu() { ? tr::lng_disable_notifications_from_tray(tr::now) : tr::lng_enable_notifications_from_tray(tr::now); - if (Platform::IsLinux()) { + if (Platform::IsLinux() && !Platform::IsWayland()) { trayIconMenu->addAction(tr::lng_open_from_tray(tr::now), this, SLOT(showFromTray())); } trayIconMenu->addAction(tr::lng_minimize_to_tray(tr::now), this, SLOT(minimizeToTray())); @@ -596,12 +596,12 @@ void MainWindow::updateTrayMenu(bool force) { if (!trayIconMenu || (Platform::IsWindows() && !force)) return; auto actions = trayIconMenu->actions(); - if (Platform::IsLinux()) { + if (Platform::IsLinux() && !Platform::IsWayland()) { auto minimizeAction = actions.at(1); minimizeAction->setEnabled(isVisible()); } else { updateIsActive(0); - auto active = isActive(); + auto active = Platform::IsWayland() ? isVisible() : isActive(); auto toggleAction = actions.at(0); disconnect(toggleAction, SIGNAL(triggered(bool)), this, SLOT(minimizeToTray())); disconnect(toggleAction, SIGNAL(triggered(bool)), this, SLOT(showFromTray())); @@ -610,7 +610,7 @@ void MainWindow::updateTrayMenu(bool force) { ? tr::lng_minimize_to_tray(tr::now) : tr::lng_open_from_tray(tr::now)); } - auto notificationAction = actions.at(Platform::IsLinux() ? 2 : 1); + auto notificationAction = actions.at(Platform::IsLinux() && !Platform::IsWayland() ? 2 : 1); auto notificationActionText = Global::DesktopNotify() ? tr::lng_disable_notifications_from_tray(tr::now) : tr::lng_enable_notifications_from_tray(tr::now); @@ -735,7 +735,7 @@ void MainWindow::handleTrayIconActication( updateTrayMenu(true); QTimer::singleShot(1, this, SLOT(psShowTrayMenu())); } else if (!skipTrayClick()) { - if (isActive()) { + if (Platform::IsWayland() ? isVisible() : isActive()) { minimizeToTray(); } else { showFromTray(reason);