diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index e8e840bcb..0d58ac4fc 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -23,12 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "storage/localstorage.h" #include "window/window_controller.h" #include "window/window_session_controller.h" -#include "media/player/media_player_instance.h" -#include "media/audio/media_audio.h" #include "base/platform/base_platform_info.h" -#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION -#include "platform/linux/linux_gsd_media_keys.h" -#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION #include "base/call_delayed.h" #include "ui/widgets/popup_menu.h" #include "ui/widgets/input_fields.h" @@ -241,13 +236,6 @@ QIcon TrayIconGen(int counter, bool muted) { } const auto iconName = GetTrayIconName(counter, muted); - const auto panelIconName = GetPanelIconName(counter, muted); - - if (iconName == panelIconName) { - const auto result = QIcon::fromTheme(iconName); - UpdateIconRegenerationNeeded(result, counter, muted, iconThemeName); - return result; - } if (UseIconFromTheme(iconName)) { const auto result = QIcon::fromTheme(iconName); @@ -682,17 +670,6 @@ void MainWindow::initHook() { } else { LOG(("Not using Unity launcher counter.")); } - - Media::Player::instance()->updatedNotifier( - ) | rpl::start_with_next([=](const Media::Player::TrackState &state) { - if (!Media::Player::IsStoppedOrStopping(state.state)) { - if (!_gsdMediaKeys) { - _gsdMediaKeys = std::make_unique(); - } - } else if (_gsdMediaKeys) { - _gsdMediaKeys = nullptr; - } - }, lifetime()); #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION LOG(("System tray available: %1").arg(Logs::b(trayAvailable()))); diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.h b/Telegram/SourceFiles/platform/linux/main_window_linux.h index 12519940a..04a7b2007 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.h +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.h @@ -21,11 +21,6 @@ class StatusNotifierItem; #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION namespace Platform { -#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION -namespace internal { -class GSDMediaKeys; -} // namespace internal -#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION class MainWindow : public Window::MainWindow { public: @@ -92,8 +87,6 @@ private: bool _appMenuSupported = false; DBusMenuExporter *_mainMenuExporter = nullptr; - std::unique_ptr _gsdMediaKeys; - QMenu *psMainMenu = nullptr; QAction *psLogout = nullptr; QAction *psUndo = nullptr; diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 73e86c8c3..c7c809e6e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -5,6 +5,7 @@ icon: Telegram/Resources/art/icon512@2x.png base: core20 grade: stable confinement: strict +compression: lzo architectures: - build-on: amd64 @@ -75,9 +76,10 @@ parts: source: . source-type: git parse-info: [usr/share/metainfo/kotatogram-desktop_kotatogram-desktop.appdata.xml] + build-environment: + - LD_LIBRARY_PATH: $SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:$LD_LIBRARY_PATH build-packages: - python - - qtbase5-private-dev - libasound2-dev - libglib2.0-dev - libglibmm-2.4-dev @@ -85,7 +87,6 @@ parts: - liblzma-dev - libopus-dev - libpulse-dev - - libqt5waylandclient5-dev - libssl-dev - libxcb1-dev - libxcb-keysyms1-dev @@ -93,8 +94,6 @@ parts: - libxcb-screensaver0-dev - zlib1g-dev stage-packages: - - qt5-image-formats-plugins - - qtwayland5 - libasound2 - libglib2.0-0 - libglibmm-2.4-1v5 @@ -102,7 +101,6 @@ parts: - liblzma5 - libopus0 - libpulse0 - - libqt5waylandclient5 - libssl1.1 - libxcb1 - libxcb-keysyms1 @@ -115,7 +113,7 @@ parts: - -DTDESKTOP_API_ID=611335 - -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c - -DDESKTOP_APP_USE_PACKAGED_LAZY=ON - - -DDESKTOP_APP_QTWAYLANDCLIENT_PRIVATE_HEADERS=$SNAPCRAFT_STAGE/usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5/QtWaylandClient/5.12.8 + - -DDESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES=OFF - -DTDESKTOP_LAUNCHER_BASENAME=kotatogram-desktop_kotatogram-desktop override-pull: | snapcraftctl pull @@ -132,11 +130,19 @@ parts: after: - desktop-qt5 - ffmpeg + - kwayland - mozjpeg - openal - - qtwayland - webrtc + patches: + source: https://github.com/desktop-app/patches.git + source-depth: 1 + plugin: dump + organize: + "*": patches/ + prime: [-./*] + desktop-qt5: source: https://github.com/ubuntu/snapcraft-desktop-helpers.git source-subdir: qt @@ -144,7 +150,6 @@ parts: make-parameters: ["FLAVOR=qt5"] build-packages: - build-essential - - qtbase5-dev - dpkg-dev stage-packages: - libxkbcommon0 @@ -154,26 +159,25 @@ parts: - adwaita-icon-theme - gnome-themes-standard - shared-mime-info - - libqt5gui5 - libgdk-pixbuf2.0-0 - - libqt5svg5 # for loading icon themes which are svg - - try: [appmenu-qt5] # not available on core18 - locales-all - xdg-user-dirs - - fcitx-frontend-qt5 stage: - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2 after: - mozjpeg + - qt5 - qt5-xdgdesktopportal-platform: - plugin: nil - stage-packages: - - qt5-xdgdesktopportal-platformtheme - stage: - - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2 - after: - - mozjpeg + extra-cmake-modules: + source: https://github.com/KDE/extra-cmake-modules.git + source-depth: 1 + source-tag: v5.77.0 + plugin: cmake + cmake-parameters: + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX=/usr + - -DBUILD_TESTING=OFF + prime: [-./*] ffmpeg: plugin: nil @@ -194,6 +198,32 @@ parts: after: - mozjpeg + kwayland: + source: https://github.com/KDE/kwayland.git + source-depth: 1 + source-tag: v5.77.0 + plugin: cmake + build-packages: + - libwayland-dev + - wayland-protocols + stage-packages: + - libwayland-client0 + - libwayland-server0 + cmake-parameters: + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX=/usr + - -DBUILD_TESTING=OFF + prime: + - -./usr/include + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libexec + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig + - -./usr/mkspecs + - -./usr/share + after: + - extra-cmake-modules + - desktop-qt5 + - plasma-wayland-protocols + mozjpeg: source: https://github.com/mozilla/mozjpeg.git source-depth: 1 @@ -212,9 +242,9 @@ parts: - -./usr/share openal: - source: https://github.com/kcat/openal-soft.git + source: https://github.com/telegramdesktop/openal-soft.git source-depth: 1 - source-tag: openal-soft-1.21.0 + source-branch: fix_pulse_default plugin: cmake build-packages: - libasound2-dev @@ -234,19 +264,149 @@ parts: - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig - qtwayland: - source: https://github.com/qt/qtwayland.git + plasma-wayland-protocols: + source: https://github.com/KDE/plasma-wayland-protocols.git source-depth: 1 - source-tag: v5.12.8 - plugin: dump - override-build: | - qmake - make -j$(nproc) - make INSTALL_ROOT="$SNAPCRAFT_PART_INSTALL" install - stage: [-./usr/lib] + source-tag: v1.1.1 + plugin: cmake + cmake-parameters: + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX=/usr prime: [-./*] after: - - desktop-qt5 + - extra-cmake-modules + + qt5: + plugin: nil + build-packages: + - libdbus-1-dev + - libegl-dev + - libfontconfig1-dev + - libfreetype-dev + - libgl-dev + - libglib2.0-dev + - libharfbuzz-dev + - libicu-dev + - libpcre2-dev + - libpng-dev + - libssl-dev + - libwayland-dev + - libx11-dev + - libx11-xcb-dev + - libxcb1-dev + - libxcb-glx0-dev + - libxcb-icccm4-dev + - libxcb-image0-dev + - libxcb-keysyms1-dev + - libxcb-randr0-dev + - libxcb-render0-dev + - libxcb-render-util0-dev + - libxcb-shape0-dev + - libxcb-shm0-dev + - libxcb-sync-dev + - libxcb-util-dev + - libxcb-xfixes0-dev + - libxcb-xinerama0-dev + - libxcb-xinput-dev + - libxcb-xkb-dev + - libxcursor-dev + - libxkbcommon-dev + - libxkbcommon-x11-dev + - zlib1g-dev + stage-packages: + - libdbus-1-3 + - libegl1 + - libfontconfig1 + - libfreetype6 + - libgl1 + - libglib2.0-0 + - libharfbuzz0b + - libicu66 + - libpcre2-16-0 + - libpng16-16 + - libssl1.1 + - libwayland-client0 + - libwayland-cursor0 + - libwayland-egl1 + - libx11-6 + - libx11-xcb1 + - libxcb1 + - libxcb-glx0 + - libxcb-icccm4 + - libxcb-image0 + - libxcb-keysyms1 + - libxcb-randr0 + - libxcb-render0 + - libxcb-render-util0 + - libxcb-shape0 + - libxcb-shm0 + - libxcb-sync1 + - libxcb-util1 + - libxcb-xfixes0 + - libxcb-xinerama0 + - libxcb-xinput0 + - libxcb-xkb1 + - libxcursor1 + - libxkbcommon0 + - libxkbcommon-x11-0 + - zlib1g + override-pull: | + QT=5_15_2 + + git clone -b v5.15.2 --depth=1 git://code.qt.io/qt/qt5.git . + perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg + git submodule update qtbase qtwayland qtimageformats qtsvg + + cd qtbase + find $SNAPCRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply + cd ../qtwayland + find $SNAPCRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply + cd .. + override-build: | + ./configure \ + -prefix /usr \ + -bindir /usr/lib/qt5/bin \ + -libdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET \ + -docdir /usr/share/qt5/doc \ + -headerdir /usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5 \ + -datadir /usr/share/qt5 \ + -archdatadir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5 \ + -plugindir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins \ + -importdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/imports \ + -translationdir /usr/share/qt5/translations \ + -hostdatadir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5 \ + -sysconfdir /etc/xdg \ + -examplesdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/examples \ + -release \ + -opensource \ + -confirm-license \ + -no-gtk \ + -no-feature-xcb-sm \ + -no-feature-xcomposite-egl \ + -no-feature-xcomposite-glx \ + -no-feature-wayland-server \ + -openssl-linked \ + -nomake examples \ + -nomake tests \ + -I $SNAPCRAFT_STAGE/usr/include \ + -L $SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET + + make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT + make INSTALL_ROOT="$SNAPCRAFT_PART_INSTALL" install + stage: + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2 + prime: + - -./usr/include + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/bin + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/mkspecs + - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/examples + - -./usr/lib/qt5 + - -./usr/share + after: + - mozjpeg + - patches webrtc: source: https://github.com/desktop-app/tg_owt.git @@ -266,6 +426,8 @@ parts: - -DBUILD_SHARED_LIBS=OFF - -DJPEG_LIBRARY_RELEASE=$SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so - -DJPEG_INCLUDE_DIR=$SNAPCRAFT_STAGE/usr/include + # NEON support for arm 32-bit is broken and no one seem to fix it + - -DTG_OWT_ARCH_ARMV7_USE_NEON=OFF prime: [-./*] after: - ffmpeg