diff --git a/net-im/telegram-desktop/additional-files/telegram_desktop.rdef.in b/net-im/telegram-desktop/additional-files/telegram_desktop.rdef.in index ceec2ae7e..6c7caf6b7 100644 --- a/net-im/telegram-desktop/additional-files/telegram_desktop.rdef.in +++ b/net-im/telegram-desktop/additional-files/telegram_desktop.rdef.in @@ -15,7 +15,7 @@ resource app_version { resource app_signature "@APP_SIGNATURE@"; -resource("QT:QPA_FLAGS") "Q_KILL_ON_EXIT|Q_REF_TO_ARGV"; +resource("QT:QPA_FLAGS") "Q_REF_TO_ARGV"; resource vector_icon { $"6E6369660604005A0500020106023F2D01ABB6552BBE233F33AF499EC5487829" diff --git a/net-im/telegram-desktop/patches/libtgvoip-3.5.0.patchset b/net-im/telegram-desktop/patches/libtgvoip-3.5.1.patchset similarity index 99% rename from net-im/telegram-desktop/patches/libtgvoip-3.5.0.patchset rename to net-im/telegram-desktop/patches/libtgvoip-3.5.1.patchset index e4484ad4e..3cdb1e7be 100644 --- a/net-im/telegram-desktop/patches/libtgvoip-3.5.0.patchset +++ b/net-im/telegram-desktop/patches/libtgvoip-3.5.1.patchset @@ -1,6 +1,6 @@ -From 535e6b42a29b712a77d00c4986eeab35b90854bd Mon Sep 17 00:00:00 2001 +From 4f7ea110350dfac0ff954cd4249bf109a529928d Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Thu, 20 Jan 2022 14:36:06 +1000 +Date: Sat, 5 Feb 2022 21:04:18 +1000 Subject: Add Haiku support diff --git a/net-im/telegram-desktop/patches/telegram_desktop-3.5.0.patchset b/net-im/telegram-desktop/patches/telegram_desktop-3.5.1.patchset similarity index 87% rename from net-im/telegram-desktop/patches/telegram_desktop-3.5.0.patchset rename to net-im/telegram-desktop/patches/telegram_desktop-3.5.1.patchset index 338a7797b..2306e7fac 100644 --- a/net-im/telegram-desktop/patches/telegram_desktop-3.5.0.patchset +++ b/net-im/telegram-desktop/patches/telegram_desktop-3.5.1.patchset @@ -1,6 +1,6 @@ -From a479007db98f7eb2369be5dfc61701488fe395f1 Mon Sep 17 00:00:00 2001 +From 41abdebaff0f767ccc739bd7429c96545b6c6e20 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 2 Feb 2022 15:53:44 +1000 +Date: Sat, 5 Feb 2022 22:34:58 +1000 Subject: Add Haiku support @@ -71,10 +71,10 @@ index 2f0c52d..63c550a 100644 if (const auto strong = weak.get()) { showBox(Box(SettingsBox, strong)); diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp -index e35b9c2..203209d 100644 +index 1fd532c..504c62a 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp -@@ -1937,7 +1937,9 @@ void Panel::updateButtonsGeometry() { +@@ -1942,7 +1942,9 @@ void Panel::updateButtonsGeometry() { const auto muteSize = _mute->innerSize().width() + 2 * addSkip; const auto skip = st::groupCallButtonSkipSmall; const auto fullWidth = (_video->width() + skip) @@ -84,7 +84,7 @@ index e35b9c2..203209d 100644 + (muteSize + skip) + (_settings ->width() + skip) + _hangup->width(); -@@ -1948,9 +1950,13 @@ void Panel::updateButtonsGeometry() { +@@ -1953,9 +1955,13 @@ void Panel::updateButtonsGeometry() { - membersWidth - membersSkip - fullWidth) / 2; @@ -99,10 +99,10 @@ index e35b9c2..203209d 100644 _video->moveToLeft(left, buttonsTop); left += _video->width() + skip; diff --git a/Telegram/SourceFiles/core/core_settings.h b/Telegram/SourceFiles/core/core_settings.h -index 414d56d..3341fe6 100644 +index f411bd4..5b09ce7 100644 --- a/Telegram/SourceFiles/core/core_settings.h +++ b/Telegram/SourceFiles/core/core_settings.h -@@ -756,7 +756,7 @@ private: +@@ -762,7 +762,7 @@ private: rpl::variable _dialogsWidthRatio; // per-window rpl::variable _thirdColumnWidth = kDefaultThirdColumnWidth; // p-w bool _notifyFromAll = true; @@ -111,6 +111,35 @@ index 414d56d..3341fe6 100644 rpl::variable> _systemDarkMode = std::nullopt; rpl::variable _systemDarkModeEnabled = false; WindowPosition _windowPosition; // per-window +diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp +index 1641a58..3856c5e 100644 +--- a/Telegram/SourceFiles/core/sandbox.cpp ++++ b/Telegram/SourceFiles/core/sandbox.cpp +@@ -261,9 +261,12 @@ Sandbox::~Sandbox() = default; + + bool Sandbox::event(QEvent *e) { + if (e->type() == QEvent::Quit && !Quitting()) { +- Quit(QuitReason::QtQuitEvent); +- e->ignore(); +- return false; ++ if (IsAppLaunched() && App().preventsQuit(QuitReason::QtQuitEvent)) { ++ e->ignore(); ++ return false; ++ } else { ++ Quit(QuitReason::QtQuitEvent); ++ } + } else if (e->type() == QEvent::Close) { + Quit(); + } +@@ -273,7 +276,7 @@ bool Sandbox::event(QEvent *e) { + void Sandbox::socketConnected() { + LOG(("Socket connected, this is not the first application instance, sending show command...")); + _secondInstance = true; +- ++ + QString commands; + const QStringList &lst(cSendPaths()); + for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp index 0437363..7685881 100644 --- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp @@ -485,10 +514,10 @@ index 0000000..8605b28 +} // namespace Notifications +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -index 1f3744d..7f708b2 100644 +index 54eed49..7d1841d 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -@@ -34,6 +34,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +@@ -35,6 +35,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/linux/base_linux_xsettings.h" #endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION @@ -499,16 +528,7 @@ index 1f3744d..7f708b2 100644 #include #include #include -@@ -44,7 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - - #ifdef Q_OS_FREEBSD - #include --#else // Q_OS_FREEBSD -+#elif !defined (Q_OS_HAIKU) // Q_OS_FREEBSD - #include - #endif // Q_OS_FREEBSD - -@@ -67,8 +71,36 @@ using UiWaylandIntegration = Ui::Platform::WaylandIntegration; +@@ -63,8 +67,36 @@ using UiWaylandIntegration = Ui::Platform::WaylandIntegration; using Platform::internal::WaylandIntegration; namespace Platform { @@ -545,7 +565,7 @@ index 1f3744d..7f708b2 100644 constexpr auto kDesktopFile = ":/misc/telegramdesktop.desktop"_cs; constexpr auto kIconName = "telegram"_cs; constexpr auto kDarkColorLimit = 192; -@@ -616,37 +648,6 @@ void psActivateProcess(uint64 pid) { +@@ -612,37 +644,6 @@ void psActivateProcess(uint64 pid) { // objc_activateProgram(); } @@ -583,7 +603,7 @@ index 1f3744d..7f708b2 100644 QString psAppDataPath() { // Previously we used ~/.TelegramDesktop, so look there first. // If we find data there, we should still use it. -@@ -660,8 +661,11 @@ QString psAppDataPath() { +@@ -656,8 +657,11 @@ QString psAppDataPath() { return oldPath; } } @@ -596,18 +616,7 @@ index 1f3744d..7f708b2 100644 } void psDoCleanup() { -@@ -689,8 +693,9 @@ namespace Platform { - - void start() { - auto backgroundThread = true; -+#ifndef Q_OS_HAIKU - mallctl("background_thread", nullptr, nullptr, &backgroundThread, sizeof(bool)); -- -+#endif - // Prevent any later calls into setlocale() by Qt - QCoreApplicationPrivate::initLocale(); - -@@ -829,7 +834,7 @@ bool OpenSystemSettings(SystemSettingsType type) { +@@ -822,7 +826,7 @@ bool OpenSystemSettings(SystemSettingsType type) { add("mate-volume-control"); } } @@ -630,7 +639,7 @@ index 057a9b5..68abe1e 100644 SetAudioInputDeviceById(_audioDeviceModule.get(), id); #endif diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp -index 4c4faef..9ef3409 100644 +index 574260c..a78bf44 100644 --- a/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp +++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp @@ -2782,7 +2782,7 @@ public: @@ -797,6 +806,40 @@ index 033dcbd..bf7d541 100644 #ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION if (::Platform::IsX11()) { const auto xcbResult = XCBLastUserInputTime(); +diff --git a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration_dummy.cpp b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration_dummy.cpp +index 4253274..65c28e2 100644 +--- a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration_dummy.cpp ++++ b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration_dummy.cpp +@@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + + #include "base/platform/base_platform_info.h" + +-namespace Ui { ++namespace base { + namespace Platform { + + struct WaylandIntegration::Private { +@@ -34,4 +34,4 @@ void WaylandIntegration::preventDisplaySleep(bool prevent, QWindow *window) { + } + + } // namespace Platform +-} // namespace Ui ++} // namespace Base +diff --git a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp +index 690752d..f7432eb 100644 +--- a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp ++++ b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp +@@ -21,6 +21,10 @@ + #include + #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION + ++#ifdef Q_OS_HAIKU ++#include ++#endif ++ + #include + #include + diff --git a/Telegram/lib_base/base/platform/linux/base_url_scheme_linux.cpp b/Telegram/lib_base/base/platform/linux/base_url_scheme_linux.cpp index 20aed5e..61d46fc 100644 --- a/Telegram/lib_base/base/platform/linux/base_url_scheme_linux.cpp @@ -890,6 +933,19 @@ index 092b667..204e259 100644 #include "webrtc/webrtc_audio_input_tester.h" #include "webrtc/webrtc_create_adm.h" +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 465f5f7..f2f13fc 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -5,7 +5,7 @@ + # https://github.com/desktop-app/legal/blob/master/LEGAL + + add_subdirectory(external) +-if (LINUX) ++if (LINUX AND NOT HAIKU) + add_subdirectory(linux_jemalloc_helper) + endif() + if (LINUX AND NOT DESKTOP_APP_USE_PACKAGED) diff --git a/cmake/external/CMakeLists.txt b/cmake/external/CMakeLists.txt index 0922a66..3d08188 100644 --- a/cmake/external/CMakeLists.txt @@ -904,17 +960,18 @@ index 0922a66..3d08188 100644 endif() add_checked_subdirectory(jpeg) diff --git a/cmake/options_linux.cmake b/cmake/options_linux.cmake -index 65bd94a..4ca9b6e 100644 +index a12feab..76efc15 100644 --- a/cmake/options_linux.cmake +++ b/cmake/options_linux.cmake -@@ -62,11 +62,13 @@ if (DESKTOP_APP_SPECIAL_TARGET) +@@ -62,12 +62,14 @@ if (DESKTOP_APP_SPECIAL_TARGET) target_link_options(common_options INTERFACE $,,-g -flto -fuse-linker-plugin>) endif() +if (NOT HAIKU) target_link_libraries(common_options INTERFACE - desktop-app::external_jemalloc + desktop-app::linux_jemalloc_helper + $ ${CMAKE_DL_LIBS} ) +endif() diff --git a/net-im/telegram-desktop/telegram_desktop-3.5.0.recipe b/net-im/telegram-desktop/telegram_desktop-3.5.1.recipe similarity index 98% rename from net-im/telegram-desktop/telegram_desktop-3.5.0.recipe rename to net-im/telegram-desktop/telegram_desktop-3.5.1.recipe index 319c052f4..873439c4a 100644 --- a/net-im/telegram-desktop/telegram_desktop-3.5.0.recipe +++ b/net-im/telegram-desktop/telegram_desktop-3.5.1.recipe @@ -5,7 +5,7 @@ COPYRIGHT="2013-2022 Telegram" LICENSE="GNU GPL v3" REVISION="1" SOURCE_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v$portVersion/tdesktop-$portVersion-full.tar.gz" -CHECKSUM_SHA256="3b5742d05a97bd9a9602419293cfeb5023b98fba81fb465db0d881ce811f6706" +CHECKSUM_SHA256="2fb9d276e67c05f1843bad3cbe327079ae0f47710d155748b5d442fb349a58ac" SOURCE_FILENAME="tdesktop-$portVersion-full.tar.gz" SOURCE_DIR="tdesktop-$portVersion-full" srcGitRev_2="2b383fe05f8ae78ac99470b9a2b9ea22b3ee5a92"