From be02ef563cedd1037c3755918460c8bf0b0da0ec Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 31 Aug 2016 16:06:52 -0400 Subject: [PATCH] Fixed crash in tray icon toggle in new Settings in macOS / Linux. --- Telegram/SourceFiles/settings/settings_general_widget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/settings/settings_general_widget.cpp b/Telegram/SourceFiles/settings/settings_general_widget.cpp index 80516272f..60b2a15e2 100644 --- a/Telegram/SourceFiles/settings/settings_general_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_general_widget.cpp @@ -286,7 +286,7 @@ void GeneralWidget::onUpdateAutomatically() { #endif // TDESKTOP_DISABLE_AUTOUPDATE void GeneralWidget::onEnableTrayIcon() { - if ((!_enableTrayIcon->checked() || cPlatform() != dbipWindows) && !_enableTaskbarIcon->checked()) { + if ((!_enableTrayIcon->checked() || cPlatform() != dbipWindows) && _enableTaskbarIcon && !_enableTaskbarIcon->checked()) { _enableTaskbarIcon->setChecked(true); } else { updateWorkmode(); @@ -302,7 +302,7 @@ void GeneralWidget::onEnableTaskbarIcon() { } void GeneralWidget::updateWorkmode() { - DBIWorkMode newMode = (_enableTrayIcon->checked() && _enableTaskbarIcon->checked()) ? dbiwmWindowAndTray : (_enableTrayIcon->checked() ? dbiwmTrayOnly : dbiwmWindowOnly); + DBIWorkMode newMode = (_enableTrayIcon->checked() && (!_enableTaskbarIcon || _enableTaskbarIcon->checked())) ? dbiwmWindowAndTray : (_enableTrayIcon->checked() ? dbiwmTrayOnly : dbiwmWindowOnly); if (cWorkMode() != newMode && (newMode == dbiwmWindowAndTray || newMode == dbiwmTrayOnly)) { cSetSeenTrayTooltip(false); }