diff --git a/net-im/telegram-desktop/patches/telegram_desktop-1.8.9-libtgvoip.patchset b/net-im/telegram-desktop/patches/telegram_desktop-1.8.13-libtgvoip.patchset similarity index 100% rename from net-im/telegram-desktop/patches/telegram_desktop-1.8.9-libtgvoip.patchset rename to net-im/telegram-desktop/patches/telegram_desktop-1.8.13-libtgvoip.patchset diff --git a/net-im/telegram-desktop/patches/telegram_desktop-1.8.9-sonnet.patchset b/net-im/telegram-desktop/patches/telegram_desktop-1.8.13-sonnet.patchset similarity index 51% rename from net-im/telegram-desktop/patches/telegram_desktop-1.8.9-sonnet.patchset rename to net-im/telegram-desktop/patches/telegram_desktop-1.8.13-sonnet.patchset index a951c2ba5..18c1dd39d 100644 --- a/net-im/telegram-desktop/patches/telegram_desktop-1.8.9-sonnet.patchset +++ b/net-im/telegram-desktop/patches/telegram_desktop-1.8.13-sonnet.patchset @@ -1,14 +1,14 @@ -From 545bfbfb7133adb77e9bcc8a7159f7a01cd15c7a Mon Sep 17 00:00:00 2001 +From df98777e9f9c0dabedcd773bd48aca2067f7b76f Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Tue, 1 Oct 2019 22:28:55 +1000 +Date: Sat, 5 Oct 2019 18:16:54 +1000 Subject: Add Sonnet spell checking diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp -index 7c05d7e..dfb253f 100644 +index 1c0b13c..9e98c8d 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp -@@ -1371,6 +1371,8 @@ InputField::InputField( +@@ -1336,6 +1336,8 @@ InputField::InputField( setTextWithTags(_lastTextWithTags, HistoryAction::Clear); } @@ -17,25 +17,25 @@ index 7c05d7e..dfb253f 100644 startBorderAnimation(); startPlaceholderAnimation(); finishAnimating(); -@@ -3361,6 +3363,12 @@ bool InputField::revertFormatReplace() { +@@ -3305,6 +3307,12 @@ bool InputField::revertFormatReplace() { void InputField::contextMenuEventInner(QContextMenuEvent *e) { if (const auto menu = _inner->createStandardContextMenu()) { addMarkdownActions(menu, e); + if (const auto h = _SpellCheckDecorator->highlighter()) { + menu->addSeparator(); -+ menu->addAction(h->isActive() ? qsl("Disable spell checking") : qsl("Enable spell checking"), [=] { ++ menu->addAction(h->isActive() ? qstr("Disable spell checking") : qstr("Enable spell checking"), [=] { + h->setActive(!h->isActive()); + }); + } - _contextMenu = base::make_unique_q(this, menu); + _contextMenu = base::make_unique_q(this, menu); _contextMenu->popup(e->globalPos()); } diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.h b/Telegram/SourceFiles/ui/widgets/input_fields.h -index 3839304..162ecb5 100644 +index ae480a0..fe65db1 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.h +++ b/Telegram/SourceFiles/ui/widgets/input_fields.h -@@ -11,6 +11,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - #include "ui/effects/animations.h" +@@ -13,6 +13,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #include "ui/text/text_entity.h" #include "styles/style_widgets.h" +#include @@ -43,8 +43,8 @@ index 3839304..162ecb5 100644 + #include #include - -@@ -512,6 +515,8 @@ private: + #include +@@ -514,6 +517,8 @@ private: InstantReplaces _mutableInstantReplaces; bool _instantReplacesEnabled = true; @@ -52,11 +52,32 @@ index 3839304..162ecb5 100644 + }; - class MaskedInputField -diff --git a/Telegram/gyp/telegram_haiku.gypi b/Telegram/gyp/telegram_haiku.gypi -index 7c6f0b5..20dd34e 100644 ---- a/Telegram/gyp/telegram_haiku.gypi -+++ b/Telegram/gyp/telegram_haiku.gypi + class MaskedInputField : public RpWidgetWrap { +diff --git a/Telegram/gyp/common/haiku.gypi b/Telegram/gyp/common/haiku.gypi +index a1fe2c9..b6c57c3 100644 +--- a/Telegram/gyp/common/haiku.gypi ++++ b/Telegram/gyp/common/haiku.gypi +@@ -35,7 +35,16 @@ + '-Wno-missing-field-initializers', + '-Wno-sign-compare', + ], ++ 'haiku_path_include%': '@HAIKU_HEADERS@', + }, ++ 'include_dirs': [ ++ '<(haiku_path_include)/KF5/SonnetCore', ++ '<(haiku_path_include)/KF5/SonnetCore/Sonnet', ++ '<(haiku_path_include)/KF5/SonnetCore/sonnet', ++ '<(haiku_path_include)/KF5/SonnetUi', ++ '<(haiku_path_include)/KF5/SonnetUi/Sonnet', ++ '<(haiku_path_include)/KF5/SonnetUi/sonnet', ++ ], + 'conditions': [ + [ '" /dev/null --libs <@(pkgconfig_libs))', -- 2.23.0 diff --git a/net-im/telegram-desktop/patches/telegram_desktop-1.8.9.patchset b/net-im/telegram-desktop/patches/telegram_desktop-1.8.13.patchset similarity index 75% rename from net-im/telegram-desktop/patches/telegram_desktop-1.8.9.patchset rename to net-im/telegram-desktop/patches/telegram_desktop-1.8.13.patchset index 3480fd877..520053b60 100644 --- a/net-im/telegram-desktop/patches/telegram_desktop-1.8.9.patchset +++ b/net-im/telegram-desktop/patches/telegram_desktop-1.8.13.patchset @@ -1,6 +1,6 @@ -From 786c74b4348759bb5e1130b13798284b0ac3d4e0 Mon Sep 17 00:00:00 2001 +From cbe3568b0c1aca96b787aae53120ec157c169f24 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Thu, 12 Sep 2019 18:32:58 +1000 +Date: Sat, 5 Oct 2019 18:11:55 +1000 Subject: Add Haiku support @@ -12,40 +12,17 @@ index 0000000..6d80862 @@ -0,0 +1,2 @@ +[Paths] +Libraries=:/gui/art -diff --git a/Telegram/Resources/qrc/telegram_haiku.qrc b/Telegram/Resources/qrc/telegram_haiku.qrc +diff --git a/Telegram/Resources/qrc/haiku.qrc b/Telegram/Resources/qrc/haiku.qrc new file mode 100644 index 0000000..33115f9 --- /dev/null -+++ b/Telegram/Resources/qrc/telegram_haiku.qrc ++++ b/Telegram/Resources/qrc/haiku.qrc @@ -0,0 +1,5 @@ + + + ../etc/qt_haiku.conf + + -diff --git a/Telegram/SourceFiles/base/algorithm_tests.cpp b/Telegram/SourceFiles/base/algorithm_tests.cpp -index 9e3df82..3092663 100644 ---- a/Telegram/SourceFiles/base/algorithm_tests.cpp -+++ b/Telegram/SourceFiles/base/algorithm_tests.cpp -@@ -5,7 +5,11 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - - #include "base/index_based_iterator.h" - -@@ -47,4 +51,4 @@ TEST_CASE("index_based_iterator tests", "[base::algorithm]") { - auto expected = std::vector { 5 }; - REQUIRE(v == expected); - } --} -\ No newline at end of file -+} diff --git a/Telegram/SourceFiles/base/build_config.h b/Telegram/SourceFiles/base/build_config.h index 3bcb595..b97d66a 100644 --- a/Telegram/SourceFiles/base/build_config.h @@ -67,38 +44,6 @@ index 3bcb595..b97d66a 100644 #define OS_POSIX 1 #endif // OS_MAC || OS_LINUX -diff --git a/Telegram/SourceFiles/base/flags_tests.cpp b/Telegram/SourceFiles/base/flags_tests.cpp -index 786dc49..b1ed887 100644 ---- a/Telegram/SourceFiles/base/flags_tests.cpp -+++ b/Telegram/SourceFiles/base/flags_tests.cpp -@@ -5,7 +5,11 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - - #include "base/flags.h" - -diff --git a/Telegram/SourceFiles/base/flat_map_tests.cpp b/Telegram/SourceFiles/base/flat_map_tests.cpp -index e1372c4..facee18 100644 ---- a/Telegram/SourceFiles/base/flat_map_tests.cpp -+++ b/Telegram/SourceFiles/base/flat_map_tests.cpp -@@ -5,7 +5,11 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - - #include "base/flat_map.h" - #include diff --git a/Telegram/SourceFiles/base/flat_set_tests.cpp b/Telegram/SourceFiles/base/flat_set_tests.cpp index a73f1d2..77d98a6 100644 --- a/Telegram/SourceFiles/base/flat_set_tests.cpp @@ -115,23 +60,6 @@ index a73f1d2..77d98a6 100644 #include "base/flat_set.h" -diff --git a/Telegram/SourceFiles/base/tests_main.cpp b/Telegram/SourceFiles/base/tests_main.cpp -index fbdcb56..0eb0e4f 100644 ---- a/Telegram/SourceFiles/base/tests_main.cpp -+++ b/Telegram/SourceFiles/base/tests_main.cpp -@@ -6,8 +6,12 @@ For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ - #define CATCH_CONFIG_RUNNER -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" - #include "reporters/catch_reporter_compact.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - #include - - int (*TestForkedMethod)()/* = nullptr*/; diff --git a/Telegram/SourceFiles/core/crash_reports.cpp b/Telegram/SourceFiles/core/crash_reports.cpp index ce938a3..02066c7 100644 --- a/Telegram/SourceFiles/core/crash_reports.cpp @@ -146,20 +74,12 @@ index ce938a3..02066c7 100644 return qsl("Linux32Bit"); } else if (Platform::IsLinux64Bit()) { diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp -index b5a6d7f..8223fad 100644 +index 3ba2830..faa982b 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp -@@ -5,6 +5,7 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+ - #include "core/launcher.h" - - #include "platform/platform_launcher.h" -@@ -16,6 +17,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - #include "core/sandbox.h" +@@ -17,6 +17,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/concurrent_timer.h" + #include "facades.h" +#ifdef __HAIKU__ +#include @@ -169,20 +89,23 @@ index b5a6d7f..8223fad 100644 namespace Core { namespace { -@@ -273,6 +279,10 @@ int Launcher::exec() { +@@ -272,6 +277,13 @@ int Launcher::exec() { + Logs::start(this); // must be started before Platform is started + Platform::start(); // must be started before Sandbox is created - // I don't know why path is not in QT_PLUGIN_PATH by default - QCoreApplication::addLibraryPath("/usr/lib/qt/plugins"); +#if defined(Q_OS_HAIKU) + QCoreApplication::addLibraryPath("/boot/system/add-ons/Qt5"); + QCoreApplication::addLibraryPath("/boot/system/add-ons/x86/Qt5"); ++ setenv("QT_STYLE_OVERRIDE", "qwerty", false); ++ unsetenv("QT_QPA_PLATFORMTHEME"); +#endif - // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors - setenv("QT_STYLE_OVERRIDE", "qwerty", false); - // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943 -@@ -462,7 +472,16 @@ int Launcher::executeApplication() { ++ + auto result = executeApplication(); + + DEBUG_LOG(("Telegram finished, result: %1").arg(result)); +@@ -456,7 +468,16 @@ int Launcher::executeApplication() { Sandbox sandbox(this, arguments.count(), arguments.values()); - MainQueueProcessor processor; + Ui::MainQueueProcessor processor; base::ConcurrentTimerEnvironment environment; +#ifdef __HAIKU__ + int res = sandbox.start(); @@ -198,10 +121,10 @@ index b5a6d7f..8223fad 100644 } // namespace Core diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp -index 7655151..9dd6cbb 100644 +index 338d1f1..b0199cb 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp -@@ -1510,6 +1510,9 @@ bool checkReadyUpdate() { +@@ -1511,6 +1511,9 @@ bool checkReadyUpdate() { #elif defined Q_OS_LINUX // Q_OS_MAC QString curUpdater = (cExeDir() + qsl("Updater")); QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater")); @@ -212,10 +135,10 @@ index 7655151..9dd6cbb 100644 if (!updater.exists()) { QFileInfo current(curUpdater); diff --git a/Telegram/SourceFiles/media/audio/media_audio.cpp b/Telegram/SourceFiles/media/audio/media_audio.cpp -index af0935f..2dc99d5 100644 +index c1234c4..c53a191 100644 --- a/Telegram/SourceFiles/media/audio/media_audio.cpp +++ b/Telegram/SourceFiles/media/audio/media_audio.cpp -@@ -100,6 +100,7 @@ void EnumeratePlaybackDevices() { +@@ -102,6 +102,7 @@ void EnumeratePlaybackDevices() { void EnumerateCaptureDevices() { auto deviceNames = QStringList(); auto devices = alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER); @@ -223,7 +146,7 @@ index af0935f..2dc99d5 100644 Assert(devices != nullptr); while (*devices != 0) { auto deviceName8Bit = QByteArray(devices); -@@ -108,7 +109,7 @@ void EnumerateCaptureDevices() { +@@ -110,7 +111,7 @@ void EnumerateCaptureDevices() { devices += deviceName8Bit.size() + 1; } LOG(("Audio Capture Devices: %1").arg(deviceNames.join(';'))); @@ -234,10 +157,10 @@ index af0935f..2dc99d5 100644 } else { diff --git a/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp b/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp new file mode 100644 -index 0000000..a3bdb80 +index 0000000..fc9b389 --- /dev/null +++ b/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp -@@ -0,0 +1,135 @@ +@@ -0,0 +1,138 @@ +/* +This file is part of Telegram Desktop for Haiku, + @@ -256,8 +179,11 @@ index 0000000..a3bdb80 + +#include "platform/haiku/file_utilities_haiku.h" + ++#include "core/application.h" +#include "mainwindow.h" ++#include "boxes/abstract_box.h" +#include "storage/localstorage.h" ++#include "facades.h" + +#include + @@ -784,10 +710,10 @@ index 0000000..54073f5 +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp b/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp new file mode 100644 -index 0000000..45def85 +index 0000000..b0689e4 --- /dev/null +++ b/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp -@@ -0,0 +1,129 @@ +@@ -0,0 +1,141 @@ +/* +This file is part of Telegram Desktop for Haiku, + @@ -801,18 +727,30 @@ index 0000000..45def85 +GNU General Public License for more details. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -+Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com ++Copyright (c) 2018-2019 Gerasim Troeglazov, 3dEyes@gmail.com +*/ + +#include "platform/haiku/main_window_haiku.h" + +#include "styles/style_window.h" -+#include "platform/haiku/haiku_desktop_environment.h" -+#include "history/history.h" ++#include "platform/platform_notifications_manager.h" ++#include "window/notifications_manager.h" +#include "mainwindow.h" ++#include "base/crc32hash.h" +#include "core/application.h" +#include "lang/lang_keys.h" +#include "storage/localstorage.h" ++#include "ui/widgets/popup_menu.h" ++#include "window/themes/window_theme.h" ++#include "history/history.h" ++#include "facades.h" ++#include "app.h" ++ ++#include ++#include ++#include ++#include ++#include + +namespace Platform { + @@ -919,10 +857,10 @@ index 0000000..45def85 +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/haiku/main_window_haiku.h b/Telegram/SourceFiles/platform/haiku/main_window_haiku.h new file mode 100644 -index 0000000..5d27c4e +index 0000000..234283f --- /dev/null +++ b/Telegram/SourceFiles/platform/haiku/main_window_haiku.h -@@ -0,0 +1,73 @@ +@@ -0,0 +1,76 @@ +/* +This file is part of Telegram Desktop for Haiku, + @@ -936,12 +874,15 @@ index 0000000..5d27c4e +GNU General Public License for more details. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -+Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com ++Copyright (c) 2018-2019 Gerasim Troeglazov, 3dEyes@gmail.com +*/ + +#pragma once + +#include "platform/platform_main_window.h" ++#include "base/flags.h" ++ ++#include + +namespace Platform { + @@ -1093,10 +1034,10 @@ index 0000000..b6f3490 +resource app_signature "application/x-vnd.tg-notify-gate"; diff --git a/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp new file mode 100644 -index 0000000..fd96efa +index 0000000..2e59207 --- /dev/null +++ b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp -@@ -0,0 +1,219 @@ +@@ -0,0 +1,229 @@ +/* +This file is part of Telegram Desktop for Haiku, + @@ -1110,7 +1051,7 @@ index 0000000..fd96efa +GNU General Public License for more details. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -+Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com ++Copyright (c) 2018-2019 Gerasim Troeglazov, 3dEyes@gmail.com +*/ + +#ifdef __x86_64__ @@ -1136,8 +1077,18 @@ index 0000000..fd96efa +#include "platform/haiku/notifications_manager_haiku.h" + +#include "window/notifications_utilities.h" -+#include "lang/lang_keys.h" +#include "history/history.h" ++#include "lang/lang_keys.h" ++ ++#define DeclareReadOnlyVar(Type, Name) const Type &Name(); ++#define DeclareRefVar(Type, Name) DeclareReadOnlyVar(Type, Name) \ ++ Type &Ref##Name(); ++#define DeclareVar(Type, Name) DeclareRefVar(Type, Name) \ ++ void Set##Name(const Type &Name); ++ ++namespace Global { ++ DeclareVar(bool, NativeNotifications); ++} + +#include +#include @@ -1458,10 +1409,10 @@ index 0000000..d905787 +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp b/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp new file mode 100644 -index 0000000..8a5b638 +index 0000000..a3ad1b8 --- /dev/null +++ b/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp -@@ -0,0 +1,264 @@ +@@ -0,0 +1,256 @@ +/* +This file is part of Telegram Desktop for Haiku, + @@ -1626,14 +1577,6 @@ index 0000000..8a5b638 +void finish() { +} + -+bool TranslucentWindowsSupported(QPoint globalPosition) { -+ return false; -+} -+ -+bool IsApplicationActive() { -+ return static_cast(QApplication::instance())->activeWindow() != nullptr; -+} -+ +void SetApplicationIcon(const QIcon &icon) { + qApp->setWindowIcon(icon); +} @@ -1728,10 +1671,10 @@ index 0000000..8a5b638 +} diff --git a/Telegram/SourceFiles/platform/haiku/specific_haiku.h b/Telegram/SourceFiles/platform/haiku/specific_haiku.h new file mode 100644 -index 0000000..80f2062 +index 0000000..68d31bd --- /dev/null +++ b/Telegram/SourceFiles/platform/haiku/specific_haiku.h -@@ -0,0 +1,123 @@ +@@ -0,0 +1,122 @@ +/* +This file is part of Telegram Desktop for Haiku, + @@ -1761,6 +1704,9 @@ index 0000000..80f2062 +inline void SetWatchingMediaKeys(bool watching) { +} + ++inline void IgnoreApplicationActivationRightNow() { ++} ++ +inline void StartTranslucentPaint(QPainter &p, QPaintEvent *e) { +} + @@ -1779,10 +1725,6 @@ index 0000000..80f2062 + return std::nullopt; +} + -+inline constexpr bool UseMainQueueGeneric() { -+ return true; -+} -+ +} // namespace Platform + +inline QString psServerPrefix() { @@ -1855,30 +1797,18 @@ index 0000000..80f2062 +//ool linuxMoveFile(const char *from, const char *to); + +bool psLaunchMaps(const Data::LocationPoint &point); -diff --git a/Telegram/SourceFiles/platform/linux/info_linux.h b/Telegram/SourceFiles/platform/linux/info_linux.h -index f909003..169e220 100644 ---- a/Telegram/SourceFiles/platform/linux/info_linux.h -+++ b/Telegram/SourceFiles/platform/linux/info_linux.h -@@ -31,6 +31,7 @@ inline constexpr bool IsLinux64Bit() { - #endif // Q_OS_LINUX64 - } +diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h +index f40204a..847471f 100644 +--- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h ++++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h +@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #pragma once -+inline constexpr bool IsHaiku() { return false; } - inline constexpr bool IsWindows() { return false; } - inline constexpr bool IsWindowsStoreBuild() { return false; } - inline bool IsWindowsXPOrGreater() { return false; } -diff --git a/Telegram/SourceFiles/platform/mac/info_mac.h b/Telegram/SourceFiles/platform/mac/info_mac.h -index befd1b4..d5eb9a0 100644 ---- a/Telegram/SourceFiles/platform/mac/info_mac.h -+++ b/Telegram/SourceFiles/platform/mac/info_mac.h -@@ -31,6 +31,7 @@ inline constexpr bool IsMacStoreBuild() { - #endif // OS_MAC_STORE - } + #include "platform/platform_notifications_manager.h" ++#include "window/notifications_utilities.h" -+inline constexpr bool IsHaiku() { return false; } - inline constexpr bool IsWindows() { return false; } - inline constexpr bool IsWindowsStoreBuild() { return false; } - inline bool IsWindowsXPOrGreater() { return false; } + namespace Platform { + namespace Notifications { diff --git a/Telegram/SourceFiles/platform/platform_audio.h b/Telegram/SourceFiles/platform/platform_audio.h index 7705b2e..cfc1fc9 100644 --- a/Telegram/SourceFiles/platform/platform_audio.h @@ -1928,14 +1858,14 @@ index 3fe92ea..e06b16c 100644 #include "platform/win/info_win.h" #endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN diff --git a/Telegram/SourceFiles/platform/platform_launcher.h b/Telegram/SourceFiles/platform/platform_launcher.h -index 27180d0..953b47f 100644 +index 27180d0..cdcd223 100644 --- a/Telegram/SourceFiles/platform/platform_launcher.h +++ b/Telegram/SourceFiles/platform/platform_launcher.h @@ -25,6 +25,8 @@ namespace Platform { #include "platform/mac/launcher_mac.h" #elif defined Q_OS_LINUX // Q_OS_MAC #include "platform/linux/launcher_linux.h" -+#elif defined Q_OS_HAIKU ++#elif defined Q_OS_HAIKU // Q_OS_LINUX +#include "platform/haiku/launcher_haiku.h" #elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX #include "platform/win/launcher_win.h" @@ -1968,10 +1898,10 @@ index 692f4b4..a40f830 100644 #include "platform/win/notifications_manager_win.h" #endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN diff --git a/Telegram/SourceFiles/platform/platform_specific.h b/Telegram/SourceFiles/platform/platform_specific.h -index 330ba48..d58b688 100644 +index f5650f9..5cd34e5 100644 --- a/Telegram/SourceFiles/platform/platform_specific.h +++ b/Telegram/SourceFiles/platform/platform_specific.h -@@ -60,6 +60,8 @@ void finish(); +@@ -53,6 +53,8 @@ void finish(); #include "platform/mac/specific_mac.h" #elif defined Q_OS_LINUX // Q_OS_MAC #include "platform/linux/specific_linux.h" @@ -1982,10 +1912,10 @@ index 330ba48..d58b688 100644 #include "platform/win/specific_win.h" #endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN diff --git a/Telegram/SourceFiles/platform/platform_window_title.h b/Telegram/SourceFiles/platform/platform_window_title.h -index 7aed20b..dc0212c 100644 +index 6aea663..8b67814 100644 --- a/Telegram/SourceFiles/platform/platform_window_title.h +++ b/Telegram/SourceFiles/platform/platform_window_title.h -@@ -25,7 +25,7 @@ void PreviewWindowFramePaint(QImage &preview, const style::palette &palette, QRe +@@ -26,7 +26,7 @@ void PreviewWindowFramePaint(QImage &preview, const style::palette &palette, QRe #include "platform/mac/window_title_mac.h" #elif defined Q_OS_WIN // Q_OS_MAC #include "platform/win/window_title_win.h" @@ -1994,84 +1924,132 @@ index 7aed20b..dc0212c 100644 namespace Platform { -diff --git a/Telegram/SourceFiles/platform/win/info_win.h b/Telegram/SourceFiles/platform/win/info_win.h -index a399684..c9df450 100644 ---- a/Telegram/SourceFiles/platform/win/info_win.h -+++ b/Telegram/SourceFiles/platform/win/info_win.h -@@ -23,6 +23,7 @@ inline constexpr bool IsWindowsStoreBuild() { - #endif // OS_WIN_STORE - } - -+inline constexpr bool IsHaiku() { return false; } - inline constexpr bool IsMac() { return false; } - inline constexpr bool IsMacOldBuild() { return false; } - inline constexpr bool IsMacStoreBuild() { return false; } diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp -index 4a722b8..e987503 100644 ---- a/Telegram/SourceFiles/qt_functions.cpp +new file mode 100644 +index 0000000..e987503 +--- /dev/null +++ b/Telegram/SourceFiles/qt_functions.cpp -@@ -31,6 +31,8 @@ - ** - ****************************************************************************/ - +@@ -0,0 +1,96 @@ ++/**************************************************************************** ++** ++** Copyright (C) 2015 The Qt Company Ltd. ++** Contact: http://www.qt.io/licensing/ ++** ++** This file contains some parts of the Qt Toolkit. ++** ++** $QT_BEGIN_LICENSE:LGPL21$ ++** Commercial License Usage ++** Licensees holding valid commercial Qt licenses may use this file in ++** accordance with the commercial license agreement provided with the ++** Software or, alternatively, in accordance with the terms contained in ++** a written agreement between you and The Qt Company. For licensing terms ++** and conditions see http://www.qt.io/terms-conditions. For further ++** information use the contact form at http://www.qt.io/contact-us. ++** ++** GNU Lesser General Public License Usage ++** Alternatively, this file may be used under the terms of the GNU Lesser ++** General Public License version 2.1 or version 3 as published by the Free ++** Software Foundation and appearing in the file LICENSE.LGPLv21 and ++** LICENSE.LGPLv3 included in the packaging of this file. Please review the ++** following information to ensure the GNU Lesser General Public License ++** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ++** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ++** ++** As a special exception, The Qt Company gives you certain additional ++** rights. These rights are described in The Qt Company LGPL Exception ++** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ++** ++** $QT_END_LICENSE$ ++** ++****************************************************************************/ ++ +#include + - /* TODO: find a dynamic library with these symbols. */ - - /* Debian maintainer: this function is taken from qfiledialog.cpp */ -diff --git a/Telegram/SourceFiles/rpl/operators_tests.cpp b/Telegram/SourceFiles/rpl/operators_tests.cpp -index 548057f..feee15e 100644 ---- a/Telegram/SourceFiles/rpl/operators_tests.cpp -+++ b/Telegram/SourceFiles/rpl/operators_tests.cpp -@@ -5,7 +5,11 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - - #include - #include -diff --git a/Telegram/SourceFiles/rpl/producer_tests.cpp b/Telegram/SourceFiles/rpl/producer_tests.cpp -index 0267f92..0e783b0 100644 ---- a/Telegram/SourceFiles/rpl/producer_tests.cpp -+++ b/Telegram/SourceFiles/rpl/producer_tests.cpp -@@ -5,7 +5,11 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - - #include - #include -diff --git a/Telegram/SourceFiles/rpl/variable_tests.cpp b/Telegram/SourceFiles/rpl/variable_tests.cpp -index 9c697fc..36ddf56 100644 ---- a/Telegram/SourceFiles/rpl/variable_tests.cpp -+++ b/Telegram/SourceFiles/rpl/variable_tests.cpp -@@ -5,7 +5,11 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - - #include - #include ++/* TODO: find a dynamic library with these symbols. */ ++ ++/* Debian maintainer: this function is taken from qfiledialog.cpp */ ++/* ++ Makes a list of filters from ;;-separated text. ++ Used by the mac and windows implementations ++*/ ++QStringList qt_make_filter_list(const QString &filter) ++{ ++ QString f(filter); ++ ++ if (f.isEmpty()) ++ return QStringList(); ++ ++ QString sep(QLatin1String(";;")); ++ int i = f.indexOf(sep, 0); ++ if (i == -1) { ++ if (f.indexOf(QLatin1Char('\n'), 0) != -1) { ++ sep = QLatin1Char('\n'); ++ i = f.indexOf(sep, 0); ++ } ++ } ++ ++ return f.split(sep); ++} ++ ++/* Debian maintainer: this constructor is taken from qtextengine.cpp for TextPainter::drawLine */ ++QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format) ++ : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format), ++ num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe) ++{ ++} ++ ++/* Debian maintainer: this method is also taken from qtextengine.cpp */ ++// Fix up flags and underlineStyle with given info ++void QTextItemInt::initWithScriptItem(const QScriptItem &si) ++{ ++ // explicitly initialize flags so that initFontAttributes can be called ++ // multiple times on the same TextItem ++ flags = 0; ++ if (si.analysis.bidiLevel %2) ++ flags |= QTextItem::RightToLeft; ++ ascent = si.ascent; ++ descent = si.descent; ++ ++ if (charFormat.hasProperty(QTextFormat::TextUnderlineStyle)) { ++ underlineStyle = charFormat.underlineStyle(); ++ } else if (charFormat.boolProperty(QTextFormat::FontUnderline) ++ || f->d->underline) { ++ underlineStyle = QTextCharFormat::SingleUnderline; ++ } ++ ++ // compat ++ if (underlineStyle == QTextCharFormat::SingleUnderline) ++ flags |= QTextItem::Underline; ++ ++ if (f->d->overline || charFormat.fontOverline()) ++ flags |= QTextItem::Overline; ++ if (f->d->strikeOut || charFormat.fontStrikeOut()) ++ flags |= QTextItem::StrikeOut; ++} +diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp +index a757d08..122ff0f 100644 +--- a/Telegram/SourceFiles/qt_static_plugins.cpp ++++ b/Telegram/SourceFiles/qt_static_plugins.cpp +@@ -15,14 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin) + Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) + Q_IMPORT_PLUGIN(QGenericEnginePlugin) + #elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC +-Q_IMPORT_PLUGIN(QWebpPlugin) +-Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) +-Q_IMPORT_PLUGIN(QConnmanEnginePlugin) +-Q_IMPORT_PLUGIN(QGenericEnginePlugin) +-Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin) +-Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) +-Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin) +-Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin) +-Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin) +-Q_IMPORT_PLUGIN(NimfInputContextPlugin) + #endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX diff --git a/Telegram/SourceFiles/settings/settings_notifications.cpp b/Telegram/SourceFiles/settings/settings_notifications.cpp -index 71ded81..4e5f922 100644 +index ea7c4a8..e19ed0f 100644 --- a/Telegram/SourceFiles/settings/settings_notifications.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications.cpp -@@ -621,7 +621,7 @@ void SetupNotificationsContent( +@@ -623,7 +623,7 @@ void SetupNotificationsContent( return QString(); } else if (Platform::IsWindows()) { return tr::lng_settings_use_windows(tr::now); @@ -2100,11 +2078,145 @@ index 4d522a9..1ca7dd0 100644 return "tests_storage"; #endif // Q_OS_WIN }(); +diff --git a/Telegram/SourceFiles/ui/painter.h b/Telegram/SourceFiles/ui/painter.h +index 627c88e..2534f1d 100644 +--- a/Telegram/SourceFiles/ui/painter.h ++++ b/Telegram/SourceFiles/ui/painter.h +@@ -19,12 +19,12 @@ public: + + void drawTextLeft(int x, int y, int outerw, const QString &text, int textWidth = -1) { + QFontMetrics m(fontMetrics()); +- if (style::RightToLeft() && textWidth < 0) textWidth = m.width(text); ++ if (style::RightToLeft() && textWidth < 0) textWidth = m.horizontalAdvance(text); + drawText(style::RightToLeft() ? (outerw - x - textWidth) : x, y + m.ascent(), text); + } + void drawTextRight(int x, int y, int outerw, const QString &text, int textWidth = -1) { + QFontMetrics m(fontMetrics()); +- if (!style::RightToLeft() && textWidth < 0) textWidth = m.width(text); ++ if (!style::RightToLeft() && textWidth < 0) textWidth = m.horizontalAdvance(text); + drawText(style::RightToLeft() ? x : (outerw - x - textWidth), y + m.ascent(), text); + } + void drawPixmapLeft(int x, int y, int outerw, const QPixmap &pix, const QRect &from) { +diff --git a/Telegram/SourceFiles/ui/platform/haiku/ui_platform_utility_haiku.cpp b/Telegram/SourceFiles/ui/platform/haiku/ui_platform_utility_haiku.cpp +new file mode 100644 +index 0000000..40b75e9 +--- /dev/null ++++ b/Telegram/SourceFiles/ui/platform/haiku/ui_platform_utility_haiku.cpp +@@ -0,0 +1,39 @@ ++/* ++This file is part of Telegram Desktop for Haiku, ++ ++You can redistribute it and/or modify it under the terms of the ++GNU General Public License as published by the Free Software Foundation, ++either version 3 of the License, or (at your option) any later version. ++ ++It is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE ++Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com ++*/ ++ ++#include "ui/platform/haiku/ui_platform_utility_haiku.h" ++ ++#include "base/flat_set.h" ++#include "ui/ui_log.h" ++ ++#include ++#include ++#include ++#include ++ ++namespace Ui { ++namespace Platform { ++ ++bool IsApplicationActive() { ++ return static_cast(QApplication::instance())->activeWindow() != nullptr; ++} ++ ++bool TranslucentWindowsSupported(QPoint globalPosition) { ++ return false; ++} ++ ++} // namespace Platform ++} // namespace Ui +diff --git a/Telegram/SourceFiles/ui/platform/haiku/ui_platform_utility_haiku.h b/Telegram/SourceFiles/ui/platform/haiku/ui_platform_utility_haiku.h +new file mode 100644 +index 0000000..0b12104 +--- /dev/null ++++ b/Telegram/SourceFiles/ui/platform/haiku/ui_platform_utility_haiku.h +@@ -0,0 +1,51 @@ ++/* ++This file is part of Telegram Desktop for Haiku, ++ ++You can redistribute it and/or modify it under the terms of the ++GNU General Public License as published by the Free Software Foundation, ++either version 3 of the License, or (at your option) any later version. ++ ++It is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE ++Copyright (c) 2019 Gerasim Troeglazov, 3dEyes@gmail.com ++*/ ++ ++#pragma once ++ ++class QPainter; ++class QPaintEvent; ++ ++namespace Ui { ++namespace Platform { ++ ++inline void StartTranslucentPaint(QPainter &p, QPaintEvent *e) { ++} ++ ++inline void InitOnTopPanel(not_null panel) { ++} ++ ++inline void DeInitOnTopPanel(not_null panel) { ++} ++ ++inline void ReInitOnTopPanel(not_null panel) { ++} ++ ++inline void UpdateOverlayed(not_null widget) { ++} ++ ++inline void ShowOverAll(not_null widget, bool canFocus) { ++} ++ ++inline void BringToBack(not_null widget) { ++} ++ ++inline constexpr bool UseMainQueueGeneric() { ++ return true; ++} ++ ++} // namespace Platform ++} // namespace Ui +diff --git a/Telegram/SourceFiles/ui/platform/ui_platform_utility.h b/Telegram/SourceFiles/ui/platform/ui_platform_utility.h +index 62c2fdf..0b4e851 100644 +--- a/Telegram/SourceFiles/ui/platform/ui_platform_utility.h ++++ b/Telegram/SourceFiles/ui/platform/ui_platform_utility.h +@@ -39,6 +39,8 @@ void DrainMainQueue(); // Needed only if UseMainQueueGeneric() is false. + #include "ui/platform/mac/ui_platform_utility_mac.h" + #elif defined Q_OS_LINUX // Q_OS_MAC + #include "ui/platform/linux/ui_platform_utility_linux.h" ++#elif defined Q_OS_HAIKU // Q_OS_LINUX ++#include "ui/platform/haiku/ui_platform_utility_haiku.h" + #elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX + #include "ui/platform/win/ui_platform_utility_win.h" + #endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN diff --git a/Telegram/SourceFiles/ui/style/style_core_font.cpp b/Telegram/SourceFiles/ui/style/style_core_font.cpp -index 11655ab..ed6db17 100644 +index 653dbff..1e10a9c 100644 --- a/Telegram/SourceFiles/ui/style/style_core_font.cpp +++ b/Telegram/SourceFiles/ui/style/style_core_font.cpp -@@ -59,8 +59,8 @@ FontData::FontData(int size, uint32 flags, int family, Font *other) +@@ -162,8 +162,8 @@ FontData::FontData(int size, uint32 flags, int family, Font *other) f.setPixelSize(size); if (_flags & FontBold) { f.setBold(true); @@ -2116,10 +2228,10 @@ index 11655ab..ed6db17 100644 f.setItalic(_flags & FontItalic); f.setUnderline(_flags & FontUnderline); diff --git a/Telegram/SourceFiles/ui/style/style_core_font.h b/Telegram/SourceFiles/ui/style/style_core_font.h -index 566a4fe..0864fe7 100644 +index a9cd5b1..f3ca2d9 100644 --- a/Telegram/SourceFiles/ui/style/style_core_font.h +++ b/Telegram/SourceFiles/ui/style/style_core_font.h -@@ -65,13 +65,13 @@ class FontData { +@@ -73,13 +73,13 @@ class FontData { public: int32 width(const QString &str) const { @@ -2135,25 +2247,55 @@ index 566a4fe..0864fe7 100644 } QString elided(const QString &str, int32 width, Qt::TextElideMode mode = Qt::ElideRight) const { return m.elidedText(str, mode, width); -diff --git a/Telegram/SourceFiles/ui/twidget.h b/Telegram/SourceFiles/ui/twidget.h -index 6202dc7..1325c7b 100644 ---- a/Telegram/SourceFiles/ui/twidget.h -+++ b/Telegram/SourceFiles/ui/twidget.h -@@ -140,12 +140,12 @@ public: +diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp +index 7891995..eaeb52b 100644 +--- a/Telegram/SourceFiles/ui/text/text.cpp ++++ b/Telegram/SourceFiles/ui/text/text.cpp +@@ -1968,11 +1968,11 @@ private: + if (item == -1) + return; - void drawTextLeft(int x, int y, int outerw, const QString &text, int textWidth = -1) { - QFontMetrics m(fontMetrics()); -- if (rtl() && textWidth < 0) textWidth = m.width(text); -+ if (rtl() && textWidth < 0) textWidth = m.horizontalAdvance(text); - drawText(rtl() ? (outerw - x - textWidth) : x, y + m.ascent(), text); +-#ifdef OS_MAC_OLD ++#if defined(OS_MAC_OLD) || QT_VERSION < QT_VERSION_CHECK(5, 6, 0) + auto end = _e->findItem(line.from + line.length - 1); +-#else // OS_MAC_OLD ++#else + auto end = _e->findItem(line.from + line.length - 1, item); +-#endif // OS_MAC_OLD ++#endif + + auto blockIndex = _lineStartBlock; + auto currentBlock = _t->_blocks[blockIndex].get(); +diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp +index 29173c5..b47a53d 100644 +--- a/Telegram/SourceFiles/ui/text/text_block.cpp ++++ b/Telegram/SourceFiles/ui/text/text_block.cpp +@@ -334,6 +334,9 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi + + QStackTextEngine engine(part, blockFont->f); + BlockParser parser(&engine, this, minResizeWidth, _from, part); ++ QTextLayout layout(part, blockFont->f); ++ layout.beginLayout(); ++ layout.createLine(); } - void drawTextRight(int x, int y, int outerw, const QString &text, int textWidth = -1) { - QFontMetrics m(fontMetrics()); -- if (!rtl() && textWidth < 0) textWidth = m.width(text); -+ if (!rtl() && textWidth < 0) textWidth = m.horizontalAdvance(text); - drawText(rtl() ? x : (outerw - x - textWidth), y + m.ascent(), text); - } - void drawPixmapLeft(int x, int y, int outerw, const QPixmap &pix, const QRect &from) { + } + +diff --git a/Telegram/SourceFiles/ui/ui_utility.cpp b/Telegram/SourceFiles/ui/ui_utility.cpp +index 878d591..f7c4a47 100644 +--- a/Telegram/SourceFiles/ui/ui_utility.cpp ++++ b/Telegram/SourceFiles/ui/ui_utility.cpp +@@ -167,9 +167,9 @@ void SendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton + , button + , QGuiApplication::mouseButtons() | button + , QGuiApplication::keyboardModifiers() +-#ifndef OS_MAC_OLD ++#if !defined(OS_MAC_OLD) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + , Qt::MouseEventSynthesizedByApplication +-#endif // OS_MAC_OLD ++#endif + ); + ev.setTimestamp(crl::now()); + QGuiApplication::sendEvent(windowHandle, &ev); diff --git a/Telegram/ThirdParty/minizip/ioapi.c b/Telegram/ThirdParty/minizip/ioapi.c index 7f5c191..649255c 100644 --- a/Telegram/ThirdParty/minizip/ioapi.c @@ -2167,39 +2309,40 @@ index 7f5c191..649255c 100644 // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions #define FOPEN_FUNC(filename, mode) fopen(filename, mode) #define FTELLO_FUNC(stream) ftello(stream) -diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp -index 4aef7c4..79ee2af 100644 ---- a/Telegram/gyp/Telegram.gyp -+++ b/Telegram/gyp/Telegram.gyp -@@ -61,6 +61,7 @@ - 'telegram_win.gypi', - 'telegram_mac.gypi', - 'telegram_linux.gypi', -+ 'telegram_haiku.gypi', - 'openssl.gypi', - 'qt.gypi', - 'qt_moc.gypi', -@@ -98,7 +99,7 @@ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', - '<(emoji_suggestions_loc)', -- '/usr/include/minizip', -+ '<(submodules_loc)/minizip', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', -diff --git a/Telegram/gyp/common.gypi b/Telegram/gyp/common.gypi -index a4e240c..64f2f19 100644 ---- a/Telegram/gyp/common.gypi -+++ b/Telegram/gyp/common.gypi -@@ -8,6 +8,7 @@ - 'includes': [ - 'settings_win.gypi', - 'settings_mac.gypi', -+ 'settings_haiku.gypi', - 'settings_linux.gypi', +diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake +index dfe1193..0b13fc0 100644 +--- a/Telegram/gyp/PrecompiledHeader.cmake ++++ b/Telegram/gyp/PrecompiledHeader.cmake +@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input) + set(_compiler_FLAGS "@${_pch_c_flags_file}") + add_custom_command( + OUTPUT "${_output_c}" +- COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}" ++ COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} "$(C_DEFINES)" "$(C_INCLUDES)" "$(C_FLAGS)" -x c-header -o "${_output_c}" -c "${_pchfile}" + DEPENDS "${_pchfile}" "${_pch_c_flags_file}" + IMPLICIT_DEPENDS C "${_pch_header}" + COMMENT "Precompiling ${_name} for ${_target} (C)") +@@ -125,7 +125,7 @@ function(add_precompiled_header _target _input) + set(_compiler_FLAGS "@${_pch_cpp_flags_file}") + add_custom_command( + OUTPUT "${_output_cxx}" +- COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}" ++ COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} "$(CXX_DEFINES)" "$(CXX_INCLUDES)" "$(CXX_FLAGS)" -x c++-header -o "${_output_cxx}" -c "${_pchfile}" + DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}" + IMPLICIT_DEPENDS CXX "${_pch_header}" + COMMENT "Precompiling header ${_name} for ${_target} (C++)") +diff --git a/Telegram/gyp/common/common.gypi b/Telegram/gyp/common/common.gypi +index 6531a7a..242f869 100644 +--- a/Telegram/gyp/common/common.gypi ++++ b/Telegram/gyp/common/common.gypi +@@ -9,6 +9,7 @@ + 'win.gypi', + 'mac.gypi', + 'linux.gypi', ++ 'haiku.gypi', ], 'variables': { + 'variables': { @@ -29,6 +30,11 @@ }, { 'build_mac': 0, @@ -2226,228 +2369,19 @@ index a4e240c..64f2f19 100644 'official_build_target%': '', 'build_standard_win%': 'c++17', -@@ -53,6 +61,7 @@ +@@ -54,6 +62,7 @@ 'build_win%': '<(build_win)', 'build_mac%': '<(build_mac)', 'build_linux%': '<(build_linux)', + 'build_haiku%': '<(build_haiku)', 'official_build_target%': '<(official_build_target)', 'build_standard_win%': '<(build_standard_win)', - -diff --git a/Telegram/gyp/generate.py b/Telegram/gyp/generate.py -index 4194e16..c2fd3c8 100644 ---- a/Telegram/gyp/generate.py -+++ b/Telegram/gyp/generate.py -@@ -98,6 +98,11 @@ elif sys.platform == 'darwin': - gypScript = '../../../Libraries/gyp/gyp' - gypArguments.append('-Gxcode_upgrade_check_project_version=1030') - gypFormats.append('xcode') -+elif sys.platform == 'haiku1': -+ gypScript = 'gyp' -+ gypFormats.append('cmake') -+ cmakeConfigurations.append('Debug') -+ cmakeConfigurations.append('Release') - else: - gypScript = '../../../Libraries/gyp/gyp' - gypFormats.append('cmake') -diff --git a/Telegram/gyp/lib_base.gyp b/Telegram/gyp/lib_base.gyp -index 82d42d4..5bf0f18 100644 ---- a/Telegram/gyp/lib_base.gyp -+++ b/Telegram/gyp/lib_base.gyp -@@ -36,7 +36,7 @@ - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', -- '<(libs_loc)/range-v3/include', -+ '<(submodules_loc)/range/include', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', -diff --git a/Telegram/gyp/lib_export.gyp b/Telegram/gyp/lib_export.gyp -index f73aabd..07c6b35 100644 ---- a/Telegram/gyp/lib_export.gyp -+++ b/Telegram/gyp/lib_export.gyp -@@ -46,7 +46,7 @@ - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', -- '<(libs_loc)/range-v3/include', -+ '<(submodules_loc)/range/include', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', -diff --git a/Telegram/gyp/lib_ffmpeg.gyp b/Telegram/gyp/lib_ffmpeg.gyp -index b9ada53..a9a5fa8 100644 ---- a/Telegram/gyp/lib_ffmpeg.gyp -+++ b/Telegram/gyp/lib_ffmpeg.gyp -@@ -37,7 +37,7 @@ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', - '<(libs_loc)/ffmpeg', -- '<(libs_loc)/range-v3/include', -+ '<(submodules_loc)/range/include', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', -diff --git a/Telegram/gyp/lib_lottie.gyp b/Telegram/gyp/lib_lottie.gyp -index 9767651..cc629fc 100644 ---- a/Telegram/gyp/lib_lottie.gyp -+++ b/Telegram/gyp/lib_lottie.gyp -@@ -46,7 +46,7 @@ - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', -- '<(libs_loc)/range-v3/include', -+ '<(submodules_loc)/range/include', - '<(libs_loc)/zlib', - '<(libs_loc)/ffmpeg', - '<(rlottie_loc)', -diff --git a/Telegram/gyp/lib_mtproto.gyp b/Telegram/gyp/lib_mtproto.gyp -index b592cb7..4a401d9 100644 ---- a/Telegram/gyp/lib_mtproto.gyp -+++ b/Telegram/gyp/lib_mtproto.gyp -@@ -47,7 +47,7 @@ - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', -- '<(libs_loc)/range-v3/include', -+ '<(submodules_loc)/range/include', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', -diff --git a/Telegram/gyp/lib_storage.gyp b/Telegram/gyp/lib_storage.gyp -index d72f4b5..e8740b9 100644 ---- a/Telegram/gyp/lib_storage.gyp -+++ b/Telegram/gyp/lib_storage.gyp -@@ -41,7 +41,7 @@ - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', -- '<(libs_loc)/range-v3/include', -+ '<(submodules_loc)/range/include', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', -diff --git a/Telegram/gyp/list_sources.py b/Telegram/gyp/list_sources.py -index 9efee62..d978ed6 100644 ---- a/Telegram/gyp/list_sources.py -+++ b/Telegram/gyp/list_sources.py -@@ -113,6 +113,8 @@ if input_path != '': - platform_rules[file_path] = [ 'mac' ] - elif '/platform/linux/' in file_path: - platform_rules[file_path] = [ 'linux' ] -+ elif '/platform/haiku/' in file_path: -+ platform_rules[file_path] = [ 'haiku' ] - - for replace in replaces: - replace_parts = replace.split('=', 1) -diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi -index 3f91776..8f3e531 100644 ---- a/Telegram/gyp/qt.gypi -+++ b/Telegram/gyp/qt.gypi -@@ -14,7 +14,7 @@ - [ 'build_macold', { - 'qt_version%': '5.3.2', - }, { -- 'qt_version%': ' /dev/null --libs <@(pkgconfig_libs))', + ], + 'configurations': { @@ -2615,29 +2818,29 @@ index 0000000..7c6f0b5 + 'cmake_precompiled_header_script': 'PrecompiledHeader.cmake', + }]], +} -diff --git a/Telegram/gyp/telegram_qrc.gypi b/Telegram/gyp/telegram_qrc.gypi -index d9147d6..16c9d3f 100644 ---- a/Telegram/gyp/telegram_qrc.gypi -+++ b/Telegram/gyp/telegram_qrc.gypi -@@ -25,6 +25,13 @@ +diff --git a/Telegram/gyp/telegram/qrc.gypi b/Telegram/gyp/telegram/qrc.gypi +index 389ca8c..dbad7f4 100644 +--- a/Telegram/gyp/telegram/qrc.gypi ++++ b/Telegram/gyp/telegram/qrc.gypi +@@ -26,6 +26,13 @@ ], } }], + [ 'build_haiku', { + 'variables': { + 'qrc_files': [ -+ '<(res_loc)/qrc/telegram_haiku.qrc', ++ '<(res_loc)/qrc/haiku.qrc', + ], + } + }], [ 'build_mac', { 'variables': { 'qrc_files': [ -diff --git a/Telegram/gyp/telegram_sources.txt b/Telegram/gyp/telegram_sources.txt -index a3f8787..d244dcd 100644 ---- a/Telegram/gyp/telegram_sources.txt -+++ b/Telegram/gyp/telegram_sources.txt -@@ -617,6 +617,20 @@ +diff --git a/Telegram/gyp/telegram/sources.txt b/Telegram/gyp/telegram/sources.txt +index 38d9d0e..fd8fd85 100644 +--- a/Telegram/gyp/telegram/sources.txt ++++ b/Telegram/gyp/telegram/sources.txt +@@ -620,6 +620,20 @@ <(src_loc)/platform/linux/notifications_manager_linux.h <(src_loc)/platform/linux/specific_linux.cpp <(src_loc)/platform/linux/specific_linux.h @@ -2658,12 +2861,80 @@ index a3f8787..d244dcd 100644 <(src_loc)/platform/mac/file_utilities_mac.mm <(src_loc)/platform/mac/file_utilities_mac.h <(src_loc)/platform/mac/info_mac.mm +@@ -863,14 +877,7 @@ + <(src_loc)/settings.cpp + <(src_loc)/settings.h + +-platforms: !win +-<(minizip_loc)/crypt.h +-<(minizip_loc)/ioapi.c +-<(minizip_loc)/ioapi.h +-<(minizip_loc)/zip.c +-<(minizip_loc)/zip.h +-<(minizip_loc)/unzip.c +-<(minizip_loc)/unzip.h ++<(src_loc)/qt_functions.cpp + + platforms: win + <(res_loc)/winrc/Telegram.rc +diff --git a/Telegram/gyp/telegram/telegram.gypi b/Telegram/gyp/telegram/telegram.gypi +index c207db6..7123cbc 100644 +--- a/Telegram/gyp/telegram/telegram.gypi ++++ b/Telegram/gyp/telegram/telegram.gypi +@@ -57,6 +57,7 @@ + 'win.gypi', + 'mac.gypi', + 'linux.gypi', ++ 'haiku.gypi', + '../modules/openssl.gypi', + '../modules/qt.gypi', + '../modules/qt_moc.gypi', +@@ -72,7 +73,6 @@ + 'codegen.gyp:codegen_numbers', + 'codegen.gyp:codegen_style', + 'tests/tests.gyp:tests', +- 'utils.gyp:Updater', + '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip', + 'crl.gyp:crl', + 'lib_base.gyp:lib_base', +@@ -85,7 +85,6 @@ + ], + + 'defines': [ +- 'AL_LIBTYPE_STATIC', + 'AL_ALEXT_PROTOTYPES', + 'TGVOIP_USE_CXX11_LIB', + 'XXH_INLINE_ALL', +@@ -97,18 +96,11 @@ + 'include_dirs': [ + '<(src_loc)', + '<(SHARED_INTERMEDIATE_DIR)', +- '<(libs_loc)/breakpad/src', +- '<(libs_loc)/lzma/C', +- '<(libs_loc)/zlib', +- '<(libs_loc)/ffmpeg', +- '<(libs_loc)/openal-soft/include', +- '<(libs_loc)/opus/include', +- '<(libs_loc)/range-v3/include', +- '<(minizip_loc)', +- '<(sp_media_key_tap_loc)', + '<(emoji_suggestions_loc)', ++ '<(submodules_loc)/minizip', + '<(submodules_loc)/GSL/include', + '<(submodules_loc)/variant/include', ++ '<(submodules_loc)/variant/test/include', + '<(submodules_loc)/crl/src', + '<(submodules_loc)/xxHash', + ], diff --git a/Telegram/gyp/tests/common_test.gypi b/Telegram/gyp/tests/common_test.gypi -index ab9ed3c..e549088 100644 +index 70f9653..99cc76a 100644 --- a/Telegram/gyp/tests/common_test.gypi +++ b/Telegram/gyp/tests/common_test.gypi -@@ -15,7 +15,7 @@ +@@ -13,9 +13,10 @@ + '<(src_loc)', + '<(submodules_loc)/GSL/include', '<(submodules_loc)/variant/include', ++ '<(submodules_loc)/variant/test/include', '<(submodules_loc)/Catch/include', '<(submodules_loc)/crl/src', - '<(libs_loc)/range-v3/include', @@ -2672,11 +2943,11 @@ index ab9ed3c..e549088 100644 'sources': [ '<(src_loc)/base/tests_main.cpp', diff --git a/Telegram/gyp/utils.gyp b/Telegram/gyp/utils.gyp -index bd46332..d85a403 100644 +index 63c0fa6..0ab02f5 100644 --- a/Telegram/gyp/utils.gyp +++ b/Telegram/gyp/utils.gyp -@@ -82,6 +82,13 @@ - 'lzma', +@@ -33,6 +33,13 @@ + '<(res_loc)/winrc/Updater.rc', ], }], + [ 'build_haiku', { @@ -2686,9 +2957,9 @@ index bd46332..d85a403 100644 + 'lzma', + ], + }], - [ 'build_mac', { - 'include_dirs': [ - '<(libs_loc)/openssl/include' + [ '"<(build_linux)" != "1"', { + 'sources!': [ + '<(src_loc)/_other/updater_linux.cpp', -- 2.23.0 diff --git a/net-im/telegram-desktop/patches/telegram_desktop-1.8.9-systemqt.patch b/net-im/telegram-desktop/patches/telegram_desktop-1.8.9-systemqt.patch deleted file mode 100644 index fab090166..000000000 --- a/net-im/telegram-desktop/patches/telegram_desktop-1.8.9-systemqt.patch +++ /dev/null @@ -1,552 +0,0 @@ -From 69613a9fb9653d249d4d1780f49100faa893be48 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 20 Mar 2019 20:35:40 +1000 -Subject: Use system Qt - - -diff --git a/Telegram/Resources/qrc/telegram_linux.qrc b/Telegram/Resources/qrc/telegram_linux.qrc -index 164e8d4..12319be 100644 ---- a/Telegram/Resources/qrc/telegram_linux.qrc -+++ b/Telegram/Resources/qrc/telegram_linux.qrc -@@ -1,6 +1,5 @@ - - -- ../etc/qt_linux.conf - - - ../fc-custom.conf -diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp -index 1294075..faf45cd 100644 ---- a/Telegram/SourceFiles/core/launcher.cpp -+++ b/Telegram/SourceFiles/core/launcher.cpp -@@ -228,6 +228,13 @@ int Launcher::exec() { - Logs::start(this); // must be started before Platform is started - Platform::start(); // must be started before Sandbox is created - -+ // I don't know why path is not in QT_PLUGIN_PATH by default -+ QCoreApplication::addLibraryPath("/usr/lib/qt/plugins"); -+ // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors -+ setenv("QT_STYLE_OVERRIDE", "qwerty", false); -+ // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943 -+ unsetenv("QT_QPA_PLATFORMTHEME"); -+ - auto result = executeApplication(); - - DEBUG_LOG(("Telegram finished, result: %1").arg(result)); -diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp -new file mode 100644 -index 0000000..4a722b8 ---- /dev/null -+++ b/Telegram/SourceFiles/qt_functions.cpp -@@ -0,0 +1,94 @@ -+/**************************************************************************** -+** -+** Copyright (C) 2015 The Qt Company Ltd. -+** Contact: http://www.qt.io/licensing/ -+** -+** This file contains some parts of the Qt Toolkit. -+** -+** $QT_BEGIN_LICENSE:LGPL21$ -+** Commercial License Usage -+** Licensees holding valid commercial Qt licenses may use this file in -+** accordance with the commercial license agreement provided with the -+** Software or, alternatively, in accordance with the terms contained in -+** a written agreement between you and The Qt Company. For licensing terms -+** and conditions see http://www.qt.io/terms-conditions. For further -+** information use the contact form at http://www.qt.io/contact-us. -+** -+** GNU Lesser General Public License Usage -+** Alternatively, this file may be used under the terms of the GNU Lesser -+** General Public License version 2.1 or version 3 as published by the Free -+** Software Foundation and appearing in the file LICENSE.LGPLv21 and -+** LICENSE.LGPLv3 included in the packaging of this file. Please review the -+** following information to ensure the GNU Lesser General Public License -+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -+** -+** As a special exception, The Qt Company gives you certain additional -+** rights. These rights are described in The Qt Company LGPL Exception -+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -+** -+** $QT_END_LICENSE$ -+** -+****************************************************************************/ -+ -+/* TODO: find a dynamic library with these symbols. */ -+ -+/* Debian maintainer: this function is taken from qfiledialog.cpp */ -+/* -+ Makes a list of filters from ;;-separated text. -+ Used by the mac and windows implementations -+*/ -+QStringList qt_make_filter_list(const QString &filter) -+{ -+ QString f(filter); -+ -+ if (f.isEmpty()) -+ return QStringList(); -+ -+ QString sep(QLatin1String(";;")); -+ int i = f.indexOf(sep, 0); -+ if (i == -1) { -+ if (f.indexOf(QLatin1Char('\n'), 0) != -1) { -+ sep = QLatin1Char('\n'); -+ i = f.indexOf(sep, 0); -+ } -+ } -+ -+ return f.split(sep); -+} -+ -+/* Debian maintainer: this constructor is taken from qtextengine.cpp for TextPainter::drawLine */ -+QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format) -+ : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format), -+ num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe) -+{ -+} -+ -+/* Debian maintainer: this method is also taken from qtextengine.cpp */ -+// Fix up flags and underlineStyle with given info -+void QTextItemInt::initWithScriptItem(const QScriptItem &si) -+{ -+ // explicitly initialize flags so that initFontAttributes can be called -+ // multiple times on the same TextItem -+ flags = 0; -+ if (si.analysis.bidiLevel %2) -+ flags |= QTextItem::RightToLeft; -+ ascent = si.ascent; -+ descent = si.descent; -+ -+ if (charFormat.hasProperty(QTextFormat::TextUnderlineStyle)) { -+ underlineStyle = charFormat.underlineStyle(); -+ } else if (charFormat.boolProperty(QTextFormat::FontUnderline) -+ || f->d->underline) { -+ underlineStyle = QTextCharFormat::SingleUnderline; -+ } -+ -+ // compat -+ if (underlineStyle == QTextCharFormat::SingleUnderline) -+ flags |= QTextItem::Underline; -+ -+ if (f->d->overline || charFormat.fontOverline()) -+ flags |= QTextItem::Overline; -+ if (f->d->strikeOut || charFormat.fontStrikeOut()) -+ flags |= QTextItem::StrikeOut; -+} -diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp -index a757d08..122ff0f 100644 ---- a/Telegram/SourceFiles/qt_static_plugins.cpp -+++ b/Telegram/SourceFiles/qt_static_plugins.cpp -@@ -15,14 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin) - Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) - Q_IMPORT_PLUGIN(QGenericEnginePlugin) - #elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC --Q_IMPORT_PLUGIN(QWebpPlugin) --Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) --Q_IMPORT_PLUGIN(QConnmanEnginePlugin) --Q_IMPORT_PLUGIN(QGenericEnginePlugin) --Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin) --Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) --Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin) --Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin) --Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin) --Q_IMPORT_PLUGIN(NimfInputContextPlugin) - #endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX -diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp -index bc4d3d5..370e5fe 100644 ---- a/Telegram/SourceFiles/ui/text/text.cpp -+++ b/Telegram/SourceFiles/ui/text/text.cpp -@@ -1760,11 +1760,11 @@ private: - if (item == -1) - return; - --#ifdef OS_MAC_OLD -+#if defined(OS_MAC_OLD) || QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - auto end = _e->findItem(line.from + line.length - 1); --#else // OS_MAC_OLD -+#else - auto end = _e->findItem(line.from + line.length - 1, item); --#endif // OS_MAC_OLD -+#endif - - auto blockIndex = _lineStartBlock; - auto currentBlock = _t->_blocks[blockIndex].get(); -diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp -index 2959cec..04ad006 100644 ---- a/Telegram/SourceFiles/ui/text/text_block.cpp -+++ b/Telegram/SourceFiles/ui/text/text_block.cpp -@@ -332,6 +332,9 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi - - QStackTextEngine engine(part, blockFont->f); - BlockParser parser(&engine, this, minResizeWidth, _from, part); -+ QTextLayout layout(part, blockFont->f); -+ layout.beginLayout(); -+ layout.createLine(); - - CrashReports::ClearAnnotationRef("CrashString"); - } -diff --git a/Telegram/SourceFiles/ui/twidget.cpp b/Telegram/SourceFiles/ui/twidget.cpp -index 9ebe6cb..ab3418f 100644 ---- a/Telegram/SourceFiles/ui/twidget.cpp -+++ b/Telegram/SourceFiles/ui/twidget.cpp -@@ -249,9 +249,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton - , button - , QGuiApplication::mouseButtons() | button - , QGuiApplication::keyboardModifiers() --#ifndef OS_MAC_OLD -+#if !defined(OS_MAC_OLD) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - , Qt::MouseEventSynthesizedByApplication --#endif // OS_MAC_OLD -+#endif - ); - ev.setTimestamp(crl::now()); - QGuiApplication::sendEvent(windowHandle, &ev); -diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake -index a0e1e04..2231130 100644 ---- a/Telegram/gyp/PrecompiledHeader.cmake -+++ b/Telegram/gyp/PrecompiledHeader.cmake -@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input) - set(_compiler_FLAGS "@${_pch_c_flags_file}") - add_custom_command( - OUTPUT "${_output_c}" -- COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}" -+ COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} "$(C_DEFINES)" "$(C_INCLUDES)" "$(C_FLAGS)" -x c-header -o "${_output_c}" -c "${_pchfile}" - DEPENDS "${_pchfile}" "${_pch_c_flags_file}" - IMPLICIT_DEPENDS C "${_pch_header}" - COMMENT "Precompiling ${_name} for ${_target} (C)") -@@ -125,7 +125,7 @@ function(add_precompiled_header _target _input) - set(_compiler_FLAGS "@${_pch_cpp_flags_file}") - add_custom_command( - OUTPUT "${_output_cxx}" -- COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}" -+ COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} "$(CXX_DEFINES)" "$(CXX_INCLUDES)" "$(CXX_FLAGS)" -x c++-header -o "${_output_cxx}" -c "${_pchfile}" - DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}" - IMPLICIT_DEPENDS CXX "${_pch_header}" - COMMENT "Precompiling header ${_name} for ${_target} (C++)") -diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp -index ac7696e..07193cf 100644 ---- a/Telegram/gyp/Telegram.gyp -+++ b/Telegram/gyp/Telegram.gyp -@@ -75,7 +75,6 @@ - 'codegen.gyp:codegen_numbers', - 'codegen.gyp:codegen_style', - 'tests/tests.gyp:tests', -- 'utils.gyp:Updater', - '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip', - 'crl.gyp:crl', - 'lib_base.gyp:lib_base', -@@ -84,7 +83,6 @@ - ], - - 'defines': [ -- 'AL_LIBTYPE_STATIC', - 'AL_ALEXT_PROTOTYPES', - 'TGVOIP_USE_CXX11_LIB', - 'XXH_INLINE_ALL', -@@ -96,16 +94,8 @@ - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', -- '<(libs_loc)/breakpad/src', -- '<(libs_loc)/lzma/C', -- '<(libs_loc)/zlib', -- '<(libs_loc)/ffmpeg', -- '<(libs_loc)/openal-soft/include', -- '<(libs_loc)/opus/include', -- '<(libs_loc)/range-v3/include', -- '<(minizip_loc)', -- '<(sp_media_key_tap_loc)', - '<(emoji_suggestions_loc)', -+ '/usr/include/minizip', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', -diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi -index 0b783ec..3f91776 100644 ---- a/Telegram/gyp/qt.gypi -+++ b/Telegram/gyp/qt.gypi -@@ -14,25 +14,21 @@ - [ 'build_macold', { - 'qt_version%': '5.3.2', - }, { -- 'qt_version%': '5.6.2', -+ 'qt_version%': ' /dev/null --libs <@(pkgconfig_libs))', - ], - 'cflags_cc': [ -@@ -91,15 +83,14 @@ - }, - }, - 'conditions': [ -- [ '" /dev/null --cflags gtk+-2.0)', -- ' /dev/null --cflags glib-2.0)', -- ' /dev/null --cflags dee-1.0)', -+ ' /dev/null --cflags appindicator3-0.1)', -+ ' /dev/null --cflags gtk+-3.0)', - ], - }], ['