From 5939c54d33368f3d95f992423520250b42dd43cd Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 20 Feb 2017 13:36:25 +0300 Subject: [PATCH] Version 1.0.13: fix unnecessary window activations. A regression was introduced in 1.0.12 version which led to wrong activations of the main window: if a custom popup menu was shown for the tray icon or a custom notification was clicked. --- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/application.cpp | 3 --- Telegram/SourceFiles/core/version.h | 4 ++-- Telegram/SourceFiles/platform/mac/main_window_mac.h | 1 + Telegram/SourceFiles/platform/mac/main_window_mac.mm | 7 ++++++- Telegram/SourceFiles/pspecific_mac_p.mm | 5 +++++ Telegram/build/version | 6 +++--- changelog.txt | 11 +++++++++++ 10 files changed, 37 insertions(+), 18 deletions(-) diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index 564d69c6e2..f6d4b17ccc 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="1.0.13.0" /> Telegram Desktop Telegram Messenger LLP diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 2174767109..9157e0590b 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,12,0 - PRODUCTVERSION 1,0,12,0 + FILEVERSION 1,0,13,0 + PRODUCTVERSION 1,0,13,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -52,10 +52,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "1.0.12.0" + VALUE "FileVersion", "1.0.13.0" VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.0.12.0" + VALUE "ProductVersion", "1.0.13.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index e6cc0e4533..8a73ec166d 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,12,0 - PRODUCTVERSION 1,0,12,0 + FILEVERSION 1,0,13,0 + PRODUCTVERSION 1,0,13,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "1.0.12.0" + VALUE "FileVersion", "1.0.13.0" VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.0.12.0" + VALUE "ProductVersion", "1.0.13.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index a74aeb4025..3c600bba31 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -922,9 +922,6 @@ void AppClass::onAppStateChanged(Qt::ApplicationState state) { void AppClass::handleAppActivated() { checkLocalTime(); if (_window) { - if (_window->isHidden()) { - _window->showFromTray(); - } _window->updateIsActive(Global::OnlineFocusTimeout()); } } diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index d75bdd618e..c04dc3772b 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #define BETA_VERSION_MACRO (0ULL) -constexpr int AppVersion = 1000012; -constexpr str_const AppVersionStr = "1.0.12"; +constexpr int AppVersion = 1000013; +constexpr str_const AppVersionStr = "1.0.13"; constexpr bool AppAlphaVersion = false; constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO; diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.h b/Telegram/SourceFiles/platform/mac/main_window_mac.h index 8d5d2525b3..0695c14089 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.h +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.h @@ -104,6 +104,7 @@ protected: void closeWithoutDestroy() override; private: + void hideAndDeactivate(); void createGlobalMenu(); void updateTitleCounter(); void updateIconCounters(); diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm index 635825aaf4..f28c83e4a2 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm @@ -220,7 +220,7 @@ void MainWindow::closeWithoutDestroy() { _hideAfterFullScreenTimer.start(3000); [nsWindow toggleFullScreen:nsWindow]; } else { - [[NSApplication sharedApplication] hide: nsWindow]; + hideAndDeactivate(); } } @@ -248,6 +248,11 @@ void MainWindow::titleVisibilityChangedHook() { } void MainWindow::onHideAfterFullScreen() { + hideAndDeactivate(); +} + +void MainWindow::hideAndDeactivate() { + hide(); NSWindow *nsWindow = [reinterpret_cast(winId()) window]; [[NSApplication sharedApplication] hide: nsWindow]; } diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index 647e611604..7a3eb693c9 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -123,6 +123,11 @@ ApplicationDelegate *_sharedDelegate = nil; - (void)applicationDidBecomeActive:(NSNotification *)aNotification { if (App::app()) { App::app()->handleAppActivated(); + if (auto window = App::wnd()) { + if (window->isHidden()) { + window->showFromTray(); + } + } } } diff --git a/Telegram/build/version b/Telegram/build/version index 0f628aefb4..961d39df68 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,6 +1,6 @@ -AppVersion 1000012 +AppVersion 1000013 AppVersionStrMajor 1.0 -AppVersionStrSmall 1.0.12 -AppVersionStr 1.0.12 +AppVersionStrSmall 1.0.13 +AppVersionStr 1.0.13 AlphaChannel 0 BetaVersion 0 diff --git a/changelog.txt b/changelog.txt index 833a7d9024..897b180c77 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,14 @@ +1.0.13 (20.02.17) + +- Bug fixes and other minor improvements. + +1.0.12 (19.02.17) + +- Support for more emoji. +- Click and drag on waveform to play audio from a chosen moment. +- Added Theme editor to Settings. +- Bug fixes and other minor improvements. + 1.0.11 alpha (17.02.17) - Bug fixes and other minor improvements.