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"
ProcessorArchitecture="x64"
Publisher="CN=Telegram Messenger LLP, O=Telegram Messenger LLP, L=London, C=GB"
Version="1.0.12.0" />
Version="1.0.13.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@ -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"

View File

@ -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"

View File

@ -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());
}
}

View File

@ -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;

View File

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

View File

@ -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<NSView*>(winId()) window];
[[NSApplication sharedApplication] hide: nsWindow];
}

View File

@ -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();
}
}
}
}

View File

@ -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

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)
- Bug fixes and other minor improvements.