diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 349b8b481..9d9141559 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -21,6 +21,7 @@ jobs: matrix: defines: - "" + - "DESKTOP_APP_DISABLE_DBUS_INTEGRATION" env: GIT: "https://github.com" diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index 00a57955b..ab2fefff9 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="1.9.21.0" /> Telegram Desktop Telegram FZ-LLC diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index ef9e8ecea..30d8a84bb 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -442,6 +442,7 @@ void GifsListWidget::processPanelHideFinished() { if (const auto result = item->getResult()) { result->unload(); } + item->unloadAnimation(); }; // Preserve panel state through visibility toggles. //clearInlineRows(false); diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index 3d20b5837..551f190ad 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -247,7 +247,6 @@ void Launcher::init() { prepareSettings(); QApplication::setApplicationName(qsl("KotatogramDesktop")); - QApplication::setApplicationDisplayName(AppName.utf16()); #if defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) QApplication::setDesktopFileName(Platform::GetLauncherFilename()); diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 6305daf75..983b2964b 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,9 +22,9 @@ constexpr auto AppId = "{C4A4AE8F-B9F7-4CC7-8A6C-BF7EEE87ACA5}"_cs; constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs; constexpr auto AppName = "Kotatogram Desktop"_cs; constexpr auto AppFile = "Kotatogram"_cs; -constexpr auto AppVersion = 1009020; -constexpr auto AppVersionStr = "1.9.20"; -constexpr auto AppBetaVersion = true; +constexpr auto AppVersion = 1009021; +constexpr auto AppVersionStr = "1.9.21"; +constexpr auto AppBetaVersion = false; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; constexpr auto AppKotatoVersion = 1001009; constexpr auto AppKotatoVersionStr = "1.1.9"; diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index a29cadc62..06dd1b0c8 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -357,6 +357,11 @@ void Gif::radialAnimationCallback(crl::time now) const { } } +void Gif::unloadAnimation() { + _gif.reset(); + getShownDocument()->unload(); +} + void Gif::clipCallback(Media::Clip::Notification notification) { using namespace Media::Clip; switch (notification) { @@ -370,8 +375,7 @@ void Gif::clipCallback(Media::Clip::Notification notification) { auto frame = countFrameSize(); _gif->start(frame.width(), frame.height(), _width, height, ImageRoundRadius::None, RectPart::None); } else if (_gif->autoPausedGif() && !context()->inlineItemVisible(this)) { - _gif.reset(); - getShownDocument()->unload(); + unloadAnimation(); } } @@ -1429,6 +1433,11 @@ void Game::radialAnimationCallback(crl::time now) const { } } +void Game::unloadAnimation() { + _gif.reset(); + getResultDocument()->unload(); +} + void Game::clipCallback(Media::Clip::Notification notification) { using namespace Media::Clip; switch (notification) { @@ -1440,8 +1449,7 @@ void Game::clipCallback(Media::Clip::Notification notification) { } else if (_gif->ready() && !_gif->started()) { _gif->start(_frameSize.width(), _frameSize.height(), st::inlineThumbSize, st::inlineThumbSize, ImageRoundRadius::None, RectPart::None); } else if (_gif->autoPausedGif() && !context()->inlineItemVisible(this)) { - _gif.reset(); - getResultDocument()->unload(); + unloadAnimation(); } } diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h index f98e2cd6b..a496f8535 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h @@ -75,6 +75,8 @@ public: int resizeGetHeight(int width) override; + void unloadAnimation() override; + private: QSize countFrameSize() const; @@ -370,6 +372,8 @@ public: QPoint point, StateRequest request) const override; + void unloadAnimation() override; + private: void countFrameSize(); diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h index b506d6cae..3ee685426 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h @@ -80,6 +80,8 @@ public: PhotoData *getPreviewPhoto() const; virtual void preload() const; + virtual void unloadAnimation() { + } void update() const; void layoutChanged(); diff --git a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp index 17e537944..83ce40017 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp @@ -304,6 +304,7 @@ void Inner::hideFinish(bool completely) { if (const auto result = item->getResult()) { result->unload(); } + item->unloadAnimation(); }; clearInlineRows(false); for (const auto &[result, layout] : _inlineLayouts) { diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 78467dd9a..17b2f0b3e 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -186,8 +186,7 @@ QIcon TrayIconGen(int counter, bool muted) { .pixmap(desiredSize) .toImage(); } else { - const auto availableSizes = systemIcon - .availableSizes(); + const auto availableSizes = systemIcon.availableSizes(); const auto biggestSize = ranges::max_element( availableSizes, @@ -282,12 +281,33 @@ std::unique_ptr TrayIconFile( static const auto templateName = AppRuntimeDirectory() + kTrayIconFilename.utf16(); + const auto desiredSize = QSize(size, size); + auto ret = std::make_unique( templateName, parent); ret->open(); - icon.pixmap(size).save(ret.get()); + + if (icon.actualSize(desiredSize) == desiredSize) { + icon.pixmap(desiredSize).save(ret.get()); + } else { + const auto availableSizes = icon.availableSizes(); + + const auto biggestSize = ranges::max_element( + availableSizes, + std::less<>(), + &QSize::width); + + icon + .pixmap(*biggestSize) + .scaled( + desiredSize, + Qt::IgnoreAspectRatio, + Qt::SmoothTransformation) + .save(ret.get()); + } + ret->close(); return ret; @@ -422,13 +442,13 @@ void MainWindow::initHook() { cSetSupportTray(trayAvailable); #ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION - auto sniWatcher = new QDBusServiceWatcher( + auto sniWatcher = new QDBusServiceWatcher( kSNIWatcherService.utf16(), QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); - connect( + connect( sniWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, @@ -473,7 +493,7 @@ void MainWindow::setSNITrayIcon(int counter, bool muted, bool firstShow) { const auto iconName = GetTrayIconName(counter, muted); if (qEnvironmentVariableIsSet(kDisableTrayCounter.utf8()) - && (!iconName.isEmpty() + && ((!iconName.isEmpty() && !InSnap()) || qEnvironmentVariableIsSet(kForcePanelIcon.utf8()))) { if (_sniTrayIcon->iconName() == iconName) { return; diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 49db68c5b..04648a803 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -115,7 +115,7 @@ bool Inhibited() { const QDBusReply reply = QDBusConnection::sessionBus().call( message); - constexpr auto notSupportedErrors = { + const auto notSupportedErrors = { QDBusError::ServiceUnknown, QDBusError::InvalidArgs, }; diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index ed3dde713..892b60c60 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -280,8 +280,16 @@ QString AppRuntimeDirectory() { QStandardPaths::RuntimeLocation); if (InSandbox()) { + const auto flatpakId = [&] { + if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) { + return QString::fromLatin1(qgetenv("FLATPAK_ID")); + } else { + return GetLauncherBasename(); + } + }(); + runtimeDir += qsl("/app/") - + QString::fromLatin1(qgetenv("FLATPAK_ID")); + + flatpakId; } if (!QFileInfo::exists(runtimeDir)) { // non-systemd distros @@ -374,7 +382,7 @@ std::optional LastUserInputTime() { const QDBusReply reply = QDBusConnection::sessionBus().call( message); - constexpr auto notSupportedErrors = { + const auto notSupportedErrors = { QDBusError::ServiceUnknown, QDBusError::NotSupported, }; diff --git a/Telegram/ThirdParty/statusnotifieritem/statusnotifieritem.cpp b/Telegram/ThirdParty/statusnotifieritem/statusnotifieritem.cpp index a55079740..38f0eea1c 100644 --- a/Telegram/ThirdParty/statusnotifieritem/statusnotifieritem.cpp +++ b/Telegram/ThirdParty/statusnotifieritem/statusnotifieritem.cpp @@ -27,8 +27,8 @@ #include "statusnotifieritem.h" #include "statusnotifieritemadaptor.h" -#include #include +#include #include int StatusNotifierItem::mServiceCounter = 0; @@ -75,11 +75,16 @@ StatusNotifierItem::~StatusNotifierItem() void StatusNotifierItem::registerToHost() { - QDBusInterface interface(QLatin1String("org.kde.StatusNotifierWatcher"), - QLatin1String("/StatusNotifierWatcher"), - QLatin1String("org.kde.StatusNotifierWatcher"), - mSessionBus); - interface.asyncCall(QLatin1String("RegisterStatusNotifierItem"), mSessionBus.baseService()); + QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.kde.StatusNotifierWatcher"), + QLatin1String("/StatusNotifierWatcher"), + QLatin1String("org.kde.StatusNotifierWatcher"), + QLatin1String("RegisterStatusNotifierItem")); + + message.setArguments({ + mSessionBus.baseService() + }); + + mSessionBus.send(message); } void StatusNotifierItem::onServiceOwnerChanged(const QString& service, const QString& oldOwner, @@ -292,10 +297,23 @@ void StatusNotifierItem::Scroll(int delta, const QString &orientation) void StatusNotifierItem::showMessage(const QString& title, const QString& msg, const QString& iconName, int secs) { - QDBusInterface interface(QLatin1String("org.freedesktop.Notifications"), QLatin1String("/org/freedesktop/Notifications"), - QLatin1String("org.freedesktop.Notifications"), mSessionBus); - interface.call(QLatin1String("Notify"), mTitle, (uint) 0, iconName, title, - msg, QStringList(), QVariantMap(), secs); + QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.Notifications"), + QLatin1String("/org/freedesktop/Notifications"), + QLatin1String("org.freedesktop.Notifications"), + QLatin1String("Notify")); + + message.setArguments({ + mTitle, + (uint) 0, + iconName, + title, + msg, + QStringList(), + QVariantMap(), + secs + }); + + mSessionBus.send(message); } IconPixmapList StatusNotifierItem::iconToPixmapList(const QIcon& icon) diff --git a/Telegram/build/version b/Telegram/build/version index 02fc021df..eaf718e9a 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,7 +1,7 @@ -AppVersion 1009020 +AppVersion 1009021 AppVersionStrMajor 1.9 -AppVersionStrSmall 1.9.20 -AppVersionStr 1.9.20 -BetaChannel 1 +AppVersionStrSmall 1.9.21 +AppVersionStr 1.9.21 +BetaChannel 0 AlphaVersion 0 -AppVersionOriginal 1.9.20.beta +AppVersionOriginal 1.9.21 diff --git a/changelog.txt b/changelog.txt index 4ac9906fc..bbe824ae5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +1.9.21 (16.03.20) + +- Mark new messages as read while scrolling down through them. +- Improved spellchecking on Windows 7 and Linux. + 1.9.20 beta (14.03.20) - Fix crash in shared links search. diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8d9dc3b28..af22b2375 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -118,6 +118,10 @@ parts: snapcraftctl set-version "$version" sed -i 's|^Icon=.*|Icon=/share/icons/hicolor/512x512/apps/kotatogram.png|g' lib/xdg/kotatogramdesktop.desktop + override-build: | + snapcraftctl build + mkdir -p "$SNAPCRAFT_PART_INSTALL/etc/fonts" + cp "$SNAPCRAFT_PART_SRC/Telegram/lib_ui/qt_conf/fc-custom.conf" "$SNAPCRAFT_PART_INSTALL/etc/fonts/fonts.conf" after: - cmake - desktop-qt5 @@ -155,11 +159,13 @@ parts: - locales-all - xdg-user-dirs - fcitx-frontend-qt5 + stage: [-etc/fonts/fonts.conf] qt5-gtk-platform: plugin: nil stage-packages: - qt5-gtk-platformtheme + stage: [-etc/fonts/fonts.conf] cmake: source: "https://gitlab.kitware.com/cmake/cmake.git" @@ -191,59 +197,37 @@ parts: source-branch: release/4.2 plugin: autotools build-packages: - - libtool - - pkg-config - - texi2html - yasm - - libass-dev - - libfreetype6-dev - - libgpac-dev - - liblzma-dev + - libasound2-dev - libopus-dev - - libsdl1.2-dev - - libtheora-dev - libva-dev - libvdpau-dev - - libvorbis-dev - - libxcb1-dev - - libxcb-shm0-dev - - libxcb-xfixes0-dev - - zlib1g-dev stage-packages: - - freeglut3 - - libass9 - - libfreetype6 - - libgpac4 - - liblzma5 + - libasound2 - libopus0 - - libslang2 - - libsdl1.2debian - - libtheora0 - libva2 - libva-drm2 - libvdpau1 - - libvorbis0a - - libxcb1 - - libxcb-shm0 - - libxcb-xfixes0 - - zlib1g configflags: - --prefix=/usr - --disable-debug - --disable-programs - --disable-doc + - --disable-autodetect - --disable-everything - --disable-neon + - --disable-iconv - --enable-gpl - --enable-version3 - --enable-libopus + - --enable-vaapi + - --enable-vdpau - --enable-decoder=aac - --enable-decoder=aac_latm - --enable-decoder=aasc - --enable-decoder=flac - --enable-decoder=gif - --enable-decoder=h264 - - --enable-decoder=h264_vdpau - --enable-decoder=mp1 - --enable-decoder=mp1float - --enable-decoder=mp2 @@ -255,7 +239,6 @@ parts: - --enable-decoder=mp3on4 - --enable-decoder=mp3on4float - --enable-decoder=mpeg4 - - --enable-decoder=mpeg4_vdpau - --enable-decoder=msmpeg4v2 - --enable-decoder=msmpeg4v3 - --enable-decoder=opus