diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index d8b4814f5b..fd7b7f1f03 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9032; -static const wchar_t *AppVersionStr = L"0.9.32"; +static const int32 AppVersion = 9033; +static const wchar_t *AppVersionStr = L"0.9.33"; static const bool DevVersion = false; //#define BETA_VERSION (9030002ULL) // just comment this line to build public version diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 07dc36bc75..1b4f4c4ed9 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3606,9 +3606,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _migrated->unreadBar->destroy(); } if (_pinnedBar) { - delete _pinnedBar; - _pinnedBar = nullptr; - _inPinnedMsg = false; + destroyPinnedBar(); } _history = _migrated = 0; updateBotKeyboard(); @@ -6842,9 +6840,7 @@ void HistoryWidget::updatePinnedBar(bool force) { if (_peer && _peer->isMegagroup()) { _peer->asChannel()->mgInfo->pinnedMsgId = 0; } - delete _pinnedBar; - _pinnedBar = nullptr; - _inPinnedMsg = false; + destroyPinnedBar(); resizeEvent(0); update(); } @@ -6892,8 +6888,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { App::api()->requestMessageData(_peer->asChannel(), _pinnedBar->msgId, new ReplyEditMessageDataCallback()); } } else if (_pinnedBar) { - delete _pinnedBar; - _pinnedBar = nullptr; + destroyPinnedBar(); result = true; _scroll.scrollToY(_scroll.scrollTop() - st::replyHeight); resizeEvent(0); @@ -6901,6 +6896,12 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { return result; } +void HistoryWidget::destroyPinnedBar() { + delete _pinnedBar; + _pinnedBar = nullptr; + _inPinnedMsg = false; +} + void HistoryWidget::ReplyEditMessageDataCallback::call(ChannelData *channel, MsgId msgId) const { if (App::main()) { App::main()->messageDataReceived(channel, msgId); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 917eb73018..1ee9fc014b 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -736,6 +736,7 @@ private: PinnedBar *_pinnedBar; void updatePinnedBar(bool force = false); bool pinnedMsgVisibilityUpdated(); + void destroyPinnedBar(); void unpinDone(const MTPUpdates &updates); class ReplyEditMessageDataCallback : public SharedCallback2 { diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 571ef6f72a..b79c0f7adb 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -38,14 +38,21 @@ int main(int argc, char *argv[]) { Logs::start(); // must be started before PlatformSpecific is started PlatformSpecific::start(); // must be started before QApplication is created - //QByteArray args[] = { "-style=0" }; // prepare fake args to disable QT_STYLE_OVERRIDE env variable - //static const int a_cnt = sizeof(args) / sizeof(args[0]); - //int a_argc = a_cnt + 1; - //char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; + // prepare fake args to disable QT_STYLE_OVERRIDE env variable + // currently this is required in some desktop environments, including Xubuntu 15.10 + // when we don't default style to "none" Qt dynamically loads GTK somehow internally and + // our own GTK dynamic load and usage leads GTK errors and freeze of the current main thread + // we can't disable our own GTK loading because it is required by libappindicator, which + // provides the tray icon for this system, because Qt tray icon is broken there + // see https://github.com/telegramdesktop/tdesktop/issues/1774 + QByteArray args[] = { "-style=0" }; + static const int a_cnt = sizeof(args) / sizeof(args[0]); + int a_argc = a_cnt + 1; + char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; int result = 0; { - Application app(argc, argv); + Application app(a_argc, a_argv); result = app.exec(); } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 6b51634d3b..1687823598 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2166,6 +2166,8 @@ void MainWidget::scheduleViewIncrement(HistoryItem *item) { } void MainWidget::onViewsIncrement() { + if (!App::main() || !MTP::authedId()) return; + for (ViewsIncrement::iterator i = _viewsToIncrement.begin(); i != _viewsToIncrement.cend();) { if (_viewsIncrementRequests.contains(i.key())) { ++i; diff --git a/Telegram/Version b/Telegram/Version index 1ad348a09f..f6b6466c7f 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9032 +AppVersion 9033 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.32 -AppVersionStr 0.9.32 +AppVersionStrSmall 0.9.33 +AppVersionStr 0.9.33 DevChannel 0 BetaVersion 0 9030002