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.
This commit is contained in:
John Preston 2017-02-20 13:36:25 +03:00
parent d408fca96f
commit 5939c54d33
10 changed files with 37 additions and 18 deletions

View file

@ -9,7 +9,7 @@
<Identity Name="TelegramDesktop" <Identity Name="TelegramDesktop"
ProcessorArchitecture="x64" ProcessorArchitecture="x64"
Publisher="CN=Telegram Messenger LLP, O=Telegram Messenger LLP, L=London, C=GB" Publisher="CN=Telegram Messenger LLP, O=Telegram Messenger LLP, L=London, C=GB"
Version="1.0.12.0" /> Version="1.0.13.0" />
<Properties> <Properties>
<DisplayName>Telegram Desktop</DisplayName> <DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName> <PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View file

@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,12,0 FILEVERSION 1,0,13,0
PRODUCTVERSION 1,0,12,0 PRODUCTVERSION 1,0,13,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -52,10 +52,10 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Telegram Messenger LLP" VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop" VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "1.0.12.0" VALUE "FileVersion", "1.0.13.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "ProductName", "Telegram Desktop" VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.0.12.0" VALUE "ProductVersion", "1.0.13.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,12,0 FILEVERSION 1,0,13,0
PRODUCTVERSION 1,0,12,0 PRODUCTVERSION 1,0,13,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -43,10 +43,10 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Telegram Messenger LLP" VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop Updater" VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "1.0.12.0" VALUE "FileVersion", "1.0.13.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "ProductName", "Telegram Desktop" VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.0.12.0" VALUE "ProductVersion", "1.0.13.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -922,9 +922,6 @@ void AppClass::onAppStateChanged(Qt::ApplicationState state) {
void AppClass::handleAppActivated() { void AppClass::handleAppActivated() {
checkLocalTime(); checkLocalTime();
if (_window) { if (_window) {
if (_window->isHidden()) {
_window->showFromTray();
}
_window->updateIsActive(Global::OnlineFocusTimeout()); _window->updateIsActive(Global::OnlineFocusTimeout());
} }
} }

View file

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#define BETA_VERSION_MACRO (0ULL) #define BETA_VERSION_MACRO (0ULL)
constexpr int AppVersion = 1000012; constexpr int AppVersion = 1000013;
constexpr str_const AppVersionStr = "1.0.12"; constexpr str_const AppVersionStr = "1.0.13";
constexpr bool AppAlphaVersion = false; constexpr bool AppAlphaVersion = false;
constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO; constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO;

View file

@ -104,6 +104,7 @@ protected:
void closeWithoutDestroy() override; void closeWithoutDestroy() override;
private: private:
void hideAndDeactivate();
void createGlobalMenu(); void createGlobalMenu();
void updateTitleCounter(); void updateTitleCounter();
void updateIconCounters(); void updateIconCounters();

View file

@ -220,7 +220,7 @@ void MainWindow::closeWithoutDestroy() {
_hideAfterFullScreenTimer.start(3000); _hideAfterFullScreenTimer.start(3000);
[nsWindow toggleFullScreen:nsWindow]; [nsWindow toggleFullScreen:nsWindow];
} else { } else {
[[NSApplication sharedApplication] hide: nsWindow]; hideAndDeactivate();
} }
} }
@ -248,6 +248,11 @@ void MainWindow::titleVisibilityChangedHook() {
} }
void MainWindow::onHideAfterFullScreen() { void MainWindow::onHideAfterFullScreen() {
hideAndDeactivate();
}
void MainWindow::hideAndDeactivate() {
hide();
NSWindow *nsWindow = [reinterpret_cast<NSView*>(winId()) window]; NSWindow *nsWindow = [reinterpret_cast<NSView*>(winId()) window];
[[NSApplication sharedApplication] hide: nsWindow]; [[NSApplication sharedApplication] hide: nsWindow];
} }

View file

@ -123,6 +123,11 @@ ApplicationDelegate *_sharedDelegate = nil;
- (void)applicationDidBecomeActive:(NSNotification *)aNotification { - (void)applicationDidBecomeActive:(NSNotification *)aNotification {
if (App::app()) { if (App::app()) {
App::app()->handleAppActivated(); App::app()->handleAppActivated();
if (auto window = App::wnd()) {
if (window->isHidden()) {
window->showFromTray();
}
}
} }
} }

View file

@ -1,6 +1,6 @@
AppVersion 1000012 AppVersion 1000013
AppVersionStrMajor 1.0 AppVersionStrMajor 1.0
AppVersionStrSmall 1.0.12 AppVersionStrSmall 1.0.13
AppVersionStr 1.0.12 AppVersionStr 1.0.13
AlphaChannel 0 AlphaChannel 0
BetaVersion 0 BetaVersion 0

View file

@ -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) 1.0.11 alpha (17.02.17)
- Bug fixes and other minor improvements. - Bug fixes and other minor improvements.