diff options
Diffstat (limited to 'tdesktop.patch')
-rw-r--r-- | tdesktop.patch | 315 |
1 files changed, 183 insertions, 132 deletions
diff --git a/tdesktop.patch b/tdesktop.patch index b59eb7f43cd6..5398684eb439 100644 --- a/tdesktop.patch +++ b/tdesktop.patch @@ -1,21 +1,10 @@ -diff --git a/Telegram/Resources/qrc/linux.qrc b/Telegram/Resources/qrc/linux.qrc -index 164e8d4f2..12319be14 100644 ---- a/Telegram/Resources/qrc/linux.qrc -+++ b/Telegram/Resources/qrc/linux.qrc -@@ -1,6 +1,5 @@ - <RCC> - <qresource prefix="/qt"> -- <file alias="etc/qt.conf">../etc/qt_linux.conf</file> - </qresource> - <qresource prefix="/fc"> - <file alias="fc-custom.conf">../fc-custom.conf</file> diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp -index 3ba28309b..e280c44fa 100644 +index 7768510a0..1e4447c5b 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp -@@ -272,6 +272,19 @@ int Launcher::exec() { - Logs::start(this); // must be started before Platform is started - Platform::start(); // must be started before Sandbox is created +@@ -278,6 +278,19 @@ int Launcher::exec() { + Platform::start(); + Ui::DisableCustomScaling(); + // I don't know why path is not in QT_PLUGIN_PATH by default + QCoreApplication::addLibraryPath("/usr/lib/qt/plugins"); @@ -32,7 +21,7 @@ index 3ba28309b..e280c44fa 100644 + auto result = executeApplication(); - DEBUG_LOG(("Telegram finished, result: %1").arg(result)); + DEBUG_LOG(("Kotatogram finished, result: %1").arg(result)); diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp new file mode 100644 index 000000000..4a722b8d7 @@ -134,14 +123,13 @@ index 000000000..4a722b8d7 + flags |= QTextItem::StrikeOut; +} diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp -index a757d085f..122ff0f5d 100644 +index cc1a767cf..be47222bc 100644 --- a/Telegram/SourceFiles/qt_static_plugins.cpp +++ b/Telegram/SourceFiles/qt_static_plugins.cpp -@@ -15,14 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin) +@@ -20,13 +20,4 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) 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) @@ -152,43 +140,11 @@ index a757d085f..122ff0f5d 100644 -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 7891995be..eaeb52b35 100644 ---- a/Telegram/SourceFiles/ui/text/text.cpp -+++ b/Telegram/SourceFiles/ui/text/text.cpp -@@ -1968,11 +1968,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 29173c5c2..b47a53d76 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(); - } - } - -diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake -index dfe1193be..0b13fc098 100644 ---- a/Telegram/gyp/PrecompiledHeader.cmake -+++ b/Telegram/gyp/PrecompiledHeader.cmake +Submodule Telegram/gyp/helpers contains modified content +diff --git a/Telegram/gyp/helpers/PrecompiledHeader.cmake b/Telegram/gyp/helpers/PrecompiledHeader.cmake +index 9508bd8..15952e5 100644 +--- a/Telegram/gyp/helpers/PrecompiledHeader.cmake ++++ b/Telegram/gyp/helpers/PrecompiledHeader.cmake @@ -114,7 +114,7 @@ function(add_precompiled_header _target _input) set(_compiler_FLAGS "@${_pch_c_flags_file}") add_custom_command( @@ -207,10 +163,10 @@ index dfe1193be..0b13fc098 100644 DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}" IMPLICIT_DEPENDS CXX "${_pch_header}" COMMENT "Precompiling header ${_name} for ${_target} (C++)") -diff --git a/Telegram/gyp/common/linux.gypi b/Telegram/gyp/common/linux.gypi -index cdcdef1dc..667fbb7f3 100644 ---- a/Telegram/gyp/common/linux.gypi -+++ b/Telegram/gyp/common/linux.gypi +diff --git a/Telegram/gyp/helpers/common/linux.gypi b/Telegram/gyp/helpers/common/linux.gypi +index 12b91b0..507a6b9 100644 +--- a/Telegram/gyp/helpers/common/linux.gypi ++++ b/Telegram/gyp/helpers/common/linux.gypi @@ -11,7 +11,6 @@ 'linux_common_flags': [ '-pipe', @@ -219,7 +175,7 @@ index cdcdef1dc..667fbb7f3 100644 '-W', '-fPIC', '-Wno-unused-variable', -@@ -86,7 +85,6 @@ +@@ -87,7 +86,6 @@ ], 'defines': [ '_REENTRANT', @@ -227,39 +183,56 @@ index cdcdef1dc..667fbb7f3 100644 'QT_PLUGIN', ], 'cflags_c': [ -diff --git a/Telegram/gyp/modules/qt.gypi b/Telegram/gyp/modules/qt.gypi -index 0b783ec21..3f917765a 100644 ---- a/Telegram/gyp/modules/qt.gypi -+++ b/Telegram/gyp/modules/qt.gypi -@@ -14,25 +14,21 @@ - [ 'build_macold', { - 'qt_version%': '5.3.2', +diff --git a/Telegram/gyp/helpers/modules/openssl.gypi b/Telegram/gyp/helpers/modules/openssl.gypi +index 91f1a99..d01c463 100644 +--- a/Telegram/gyp/helpers/modules/openssl.gypi ++++ b/Telegram/gyp/helpers/modules/openssl.gypi +@@ -56,10 +56,6 @@ + '<(libs_loc)/openssl/include', + ], + }]], +- }], [ 'build_linux', { +- 'include_dirs': [ +- '/usr/local/desktop-app/openssl-1.1.1/include', +- ], + }], + ], + } +diff --git a/Telegram/gyp/helpers/modules/qt.gypi b/Telegram/gyp/helpers/modules/qt.gypi +index e329211..7c2b8b0 100644 +--- a/Telegram/gyp/helpers/modules/qt.gypi ++++ b/Telegram/gyp/helpers/modules/qt.gypi +@@ -14,27 +14,17 @@ + [ 'build_osx', { + 'qt_version%': '5.6.2', }, { -- 'qt_version%': '5.6.2', +- 'qt_version%': '5.12.5', + 'qt_version%': '<!(echo /usr/include/qt/QtCore/*/ | grep -Po "\d+\.\d+\.\d+")', }] ], }, - 'qt_libs': [ + 'qt_libs_5_12_5': [ - 'qwebp', +- 'qgif', +- 'qjpeg', - 'Qt5PrintSupport', -- 'Qt5PlatformSupport', +- 'Qt5AccessibilitySupport', +- 'Qt5FontDatabaseSupport', +- 'Qt5EventDispatcherSupport', +- 'Qt5ThemeSupport', 'Qt5Network', 'Qt5Widgets', 'Qt5Gui', -- 'qtharfbuzzng', +- 'qtharfbuzz', +- 'qtlibpng', ], 'qt_version%': '<(qt_version)', - 'conditions': [ - [ 'build_macold', { - 'linux_path_qt%': '/usr/local/macold/Qt-<(qt_version)', - }, { -- 'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)', -+ 'linux_path_qt%': '/usr/lib/qt', - }] - ] +- 'linux_path_qt%': '/usr/local/desktop-app/Qt-<(qt_version)', ++ 'linux_path_qt%': '/usr/lib/qt', }, -@@ -72,32 +68,13 @@ + 'qt_version%': '<(qt_version)', + 'qt_loc_unix': '<(linux_path_qt)', +@@ -87,32 +77,13 @@ ], }], [ 'build_linux', { @@ -272,21 +245,21 @@ index 0b783ec21..3f917765a 100644 'qt_libs': [ - 'qxcb', - 'Qt5XcbQpa', +- 'Qt5LinuxAccessibilitySupport', +- 'Qt5ServiceSupport', +- 'Qt5EdidSupport', - 'qconnmanbearer', - 'qgenericbearer', - 'qnmbearer', - '<@(qt_libs)', + '<@(qt_libs_5_12_5)', 'Qt5DBus', 'Qt5Core', -- 'qtpcre', -- 'Xi', -- 'Xext', -- 'Xfixes', +- 'qtpcre2', - 'SM', - 'ICE', - 'fontconfig', -- 'expat', - 'freetype', +- 'expat', - 'z', - 'xcb-shm', - 'xcb-xfixes', @@ -295,19 +268,19 @@ index 0b783ec21..3f917765a 100644 ], }], ], -@@ -127,11 +104,6 @@ +@@ -142,11 +113,6 @@ # '<!@(python <(DEPTH)/list_sources.py [sources] <(qt_moc_list_sources_arg))' # where [sources] contains all your source files 'qt_moc_list_sources_arg': '--moc-prefix SHARED_INTERMEDIATE_DIR/<(_target_name)/moc/moc_', - - 'linux_path_xkbcommon%': '/usr/local', -- 'linux_lib_ssl%': '/usr/local/ssl/lib/libssl.a', -- 'linux_lib_crypto%': '/usr/local/ssl/lib/libcrypto.a', +- 'linux_lib_ssl%': '/usr/local/desktop-app/openssl-1.1.1/lib/libssl.a', +- 'linux_lib_crypto%': '/usr/local/desktop-app/openssl-1.1.1/lib/libcrypto.a', - 'linux_lib_icu%': 'libicutu.a libicui18n.a libicuuc.a libicudata.a', }, 'configurations': { -@@ -180,14 +152,14 @@ +@@ -205,14 +171,14 @@ }, 'include_dirs': [ @@ -330,17 +303,23 @@ index 0b783ec21..3f917765a 100644 ], 'library_dirs': [ '<(qt_loc)/lib', -@@ -212,17 +184,10 @@ +@@ -236,24 +202,12 @@ + '<(DEPTH)/helpers/platform/linux/linux_glibc_wraps.gyp:linux_glibc_wraps', ], 'libraries': [ - '<(PRODUCT_DIR)/obj.target/liblinux_glibc_wraps.a', -- '<(linux_path_xkbcommon)/lib/libxkbcommon.a', +- '-lcomposeplatforminputcontextplugin', +- '-libusplatforminputcontextplugin', +- '-lfcitxplatforminputcontextplugin', +- '-lhimeplatforminputcontextplugin', +- '-lnimfplatforminputcontextplugin', '<@(qt_libs_release)', -- '<(linux_lib_ssl)', -- '<(linux_lib_crypto)', +- '<(linux_path_xkbcommon)/lib/libxkbcommon.a', +- '<(linux_path_xkbcommon)/lib/libxkbcommon-x11.a', + '<(PRODUCT_DIR)/obj.target/helpers/platform/linux/liblinux_glibc_wraps.a', + #'<(linux_lib_ssl)', # added in lib_ton + #'<(linux_lib_crypto)', # added in lib_ton - '<!@(python -c "for s in \'<(linux_lib_icu)\'.split(\' \'): print(s)")', - '-lxcb', -+ '-lcrypto', '-lX11', - '-lX11-xcb', - '-ldbus-1', @@ -349,7 +328,7 @@ index 0b783ec21..3f917765a 100644 '-lglib-2.0', '-lpthread', ], -@@ -230,7 +195,6 @@ +@@ -261,7 +215,6 @@ '<(qt_loc)/mkspecs/linux-g++', ], 'ldflags': [ @@ -357,10 +336,10 @@ index 0b783ec21..3f917765a 100644 '-pthread', '-rdynamic', ], -diff --git a/Telegram/gyp/modules/qt_moc.gypi b/Telegram/gyp/modules/qt_moc.gypi -index ebee90a15..75424d4bb 100644 ---- a/Telegram/gyp/modules/qt_moc.gypi -+++ b/Telegram/gyp/modules/qt_moc.gypi +diff --git a/Telegram/gyp/helpers/modules/qt_moc.gypi b/Telegram/gyp/helpers/modules/qt_moc.gypi +index 33cc236..b47ff9e 100644 +--- a/Telegram/gyp/helpers/modules/qt_moc.gypi ++++ b/Telegram/gyp/helpers/modules/qt_moc.gypi @@ -15,7 +15,7 @@ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp', ], @@ -370,24 +349,11 @@ index ebee90a15..75424d4bb 100644 # Silence "Note: No relevant classes found. No output generated." '--no-notes', -diff --git a/Telegram/gyp/modules/qt_rcc.gypi b/Telegram/gyp/modules/qt_rcc.gypi -index f5624a82b..1129a95c5 100644 ---- a/Telegram/gyp/modules/qt_rcc.gypi -+++ b/Telegram/gyp/modules/qt_rcc.gypi -@@ -15,7 +15,7 @@ - '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp', - ], - 'action': [ -- '<(qt_loc)/bin/rcc<(exe_ext)', -+ '/usr/bin/rcc', - '-name', '<(RULE_INPUT_ROOT)', - '-no-compress', - '<(RULE_INPUT_PATH)', diff --git a/Telegram/gyp/telegram/linux.gypi b/Telegram/gyp/telegram/linux.gypi -index 385f2b89f..f3ddf7e83 100644 +index ba6bc45e8..73af2b27d 100644 --- a/Telegram/gyp/telegram/linux.gypi +++ b/Telegram/gyp/telegram/linux.gypi -@@ -19,27 +19,21 @@ +@@ -19,9 +19,11 @@ #'xkbcommon', ], }, @@ -396,16 +362,12 @@ index 385f2b89f..f3ddf7e83 100644 + '/usr/lib/openssl', + ], 'libraries': [ +- '-Wl,-Bstatic', - '-lbreakpad_client', -- '-lcomposeplatforminputcontextplugin', -- '-libusplatforminputcontextplugin', -- '-lfcitxplatforminputcontextplugin', -- '-lhimeplatforminputcontextplugin', -- '-lnimfplatforminputcontextplugin', -- '-llzma', + '-llzma', '-lopenal', '-lavformat', - '-lavcodec', +@@ -29,19 +31,10 @@ '-lswresample', '-lswscale', '-lavutil', @@ -417,11 +379,17 @@ index 385f2b89f..f3ddf7e83 100644 - '-lvdpau', - '-ldrm', '-lz', -+ '-llzma', +- '-lXi', +- '-lXext', +- '-lXfixes', +- '-lXrender', +- '<(linux_lib_ssl)', +- '<(linux_lib_crypto)', ++ '-lcrypto', # '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))', ], 'cflags_cc': [ -@@ -51,7 +45,6 @@ +@@ -53,7 +46,6 @@ '-Wl,-wrap,secure_getenv', '-Wl,-wrap,clock_gettime', '-Wl,--no-as-needed,-lrt', @@ -429,7 +397,7 @@ index 385f2b89f..f3ddf7e83 100644 ], 'configurations': { 'Release': { -@@ -75,9 +68,8 @@ +@@ -77,9 +69,8 @@ ], }], ['not_need_gtk!="True"', { 'cflags_cc': [ @@ -442,10 +410,10 @@ index 385f2b89f..f3ddf7e83 100644 }], ['<!(pkg-config ayatana-appindicator3-0.1; echo $?) == 0', { 'cflags_cc': [ '<!(pkg-config --cflags ayatana-appindicator3-0.1)' ], diff --git a/Telegram/gyp/telegram/sources.txt b/Telegram/gyp/telegram/sources.txt -index 38d9d0e64..459919abf 100644 +index e3ccb66db..7cf07e97e 100644 --- a/Telegram/gyp/telegram/sources.txt +++ b/Telegram/gyp/telegram/sources.txt -@@ -863,14 +863,7 @@ +@@ -842,14 +842,7 @@ <(src_loc)/settings.cpp <(src_loc)/settings.h @@ -461,6 +429,89 @@ index 38d9d0e64..459919abf 100644 platforms: win <(res_loc)/winrc/Telegram.rc --- -2.23.0 - +diff --git a/Telegram/gyp/tests/tests.gyp b/Telegram/gyp/tests/tests.gyp +index 43ae1d696..05fe0fbba 100644 +--- a/Telegram/gyp/tests/tests.gyp ++++ b/Telegram/gyp/tests/tests.gyp +@@ -140,8 +140,7 @@ + ], + }], [ 'build_linux', { + 'libraries': [ +- '<(linux_lib_ssl)', +- '<(linux_lib_crypto)', ++ 'crypto', + ], + }]], + }], +diff --git a/Telegram/gyp/utils.gyp b/Telegram/gyp/utils.gyp +index 7d5dafaba..e250edb2b 100644 +--- a/Telegram/gyp/utils.gyp ++++ b/Telegram/gyp/utils.gyp +@@ -73,8 +73,7 @@ + }], + [ 'build_linux', { + 'libraries': [ +- '<(linux_lib_ssl)', +- '<(linux_lib_crypto)', ++ 'crypto', + 'lzma', + ], + }], +Submodule Telegram/lib_ui contains modified content +diff --git a/Telegram/lib_ui/gyp/qrc_rule.gypi b/Telegram/lib_ui/gyp/qrc_rule.gypi +index eb4654c..22419d2 100644 +--- a/Telegram/lib_ui/gyp/qrc_rule.gypi ++++ b/Telegram/lib_ui/gyp/qrc_rule.gypi +@@ -60,7 +60,7 @@ + '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp', + ], + 'action': [ +- '<(qt_loc)/bin/rcc<(exe_ext)', ++ '/usr/bin/rcc', + '-name', '<(RULE_INPUT_ROOT)', + '-no-compress', + '<(RULE_INPUT_PATH)', +diff --git a/Telegram/lib_ui/qt_conf/linux.qrc b/Telegram/lib_ui/qt_conf/linux.qrc +index b9f5692..990e7fa 100644 +--- a/Telegram/lib_ui/qt_conf/linux.qrc ++++ b/Telegram/lib_ui/qt_conf/linux.qrc +@@ -1,6 +1,5 @@ + <RCC> + <qresource prefix="/qt/etc"> +- <file alias="qt.conf">qt_linux.conf</file> + </qresource> + <qresource prefix="/fc"> + <file>fc-custom.conf</file> +diff --git a/Telegram/lib_ui/ui/text/text.cpp b/Telegram/lib_ui/ui/text/text.cpp +index 724000b..ec693a1 100644 +--- a/Telegram/lib_ui/ui/text/text.cpp ++++ b/Telegram/lib_ui/ui/text/text.cpp +@@ -1967,11 +1967,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/lib_ui/ui/text/text_block.cpp b/Telegram/lib_ui/ui/text/text_block.cpp +index 314adb7..2de07bd 100644 +--- a/Telegram/lib_ui/ui/text/text_block.cpp ++++ b/Telegram/lib_ui/ui/text/text_block.cpp +@@ -333,6 +333,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(); + } + } + |