diff --git a/Telegram/gyp/helpers b/Telegram/gyp/helpers
index 0d9d39ab7..ac60d8fa2 160000
--- a/Telegram/gyp/helpers
+++ b/Telegram/gyp/helpers
@@ -1 +1 @@
-Subproject commit 0d9d39ab7dd1ecd80235c647fc4bf62d580cbf6c
+Subproject commit ac60d8fa23ffca6bfc23efa0ee10696a47579ea6
diff --git a/Telegram/lib_ui b/Telegram/lib_ui
index 84d68e48c..199e51706 160000
--- a/Telegram/lib_ui
+++ b/Telegram/lib_ui
@@ -1 +1 @@
-Subproject commit 84d68e48c0808f6641b4ea7badc5a977052010a1
+Subproject commit 199e51706f651922cc9ab30f08306d63d462941d
diff --git a/docs/building-cmake.md b/docs/building-cmake.md
index 6bcd90d66..5f5a0df91 100644
--- a/docs/building-cmake.md
+++ b/docs/building-cmake.md
@@ -42,6 +42,7 @@ Go to ***BuildPath*** and run
     make $MAKE_THREADS_CNT
     sudo make install
 
+    git clone https://github.com/desktop-app/patches.git
     git clone --branch 0.9.1 https://github.com/ericniebler/range-v3
 
     git clone https://github.com/telegramdesktop/zlib.git
@@ -225,7 +226,7 @@ Go to ***BuildPath*** and run
     git checkout v5.6.2
     cd qtimageformats && git checkout v5.6.2 && cd ..
     cd qtbase && git checkout v5.6.2 && cd ..
-    cd qtbase && git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff && cd ..
+    cd qtbase && git apply ../../patches/qtbase_5_6_2.diff && cd ..
     cd qtbase/src/plugins/platforminputcontexts
     git clone https://github.com/telegramdesktop/fcitx.git
     git clone https://github.com/telegramdesktop/hime.git
@@ -240,8 +241,8 @@ Go to ***BuildPath*** and run
 
     git clone https://chromium.googlesource.com/external/gyp
     cd gyp
-    git checkout 702ac58e47
-    git apply ../../tdesktop/Telegram/Patches/gyp.diff
+    git checkout 9f2a7bb1
+    git apply ../patches/gyp.diff
     cd ..
 
     git clone https://chromium.googlesource.com/breakpad/breakpad
diff --git a/docs/building-msvc.md b/docs/building-msvc.md
index 74e513eba..8324432a0 100644
--- a/docs/building-msvc.md
+++ b/docs/building-msvc.md
@@ -30,9 +30,11 @@ You will require **api_id** and **api_hash** to access the Telegram API servers.
 Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath*** and run
 
     cd ThirdParty
-    git clone https://github.com/telegramdesktop/gyp.git
+    git clone https://github.com/desktop-app/patches.git
+    git clone https://chromium.googlesource.com/external/gyp
     cd gyp
-    git checkout tdesktop
+    git checkout 9f2a7bb1
+    git apply ../patches/gyp.diff
     cd ..\..
 
 Add **GYP** and **Ninja** to your PATH:
@@ -55,6 +57,7 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath***
     mkdir Libraries
     cd Libraries
 
+    git clone https://github.com/desktop-app/patches.git
     git clone --branch 0.9.1 https://github.com/ericniebler/range-v3 range-v3
 
     git clone https://github.com/telegramdesktop/lzma.git
@@ -138,7 +141,7 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath***
     git checkout v5.6.2
     cd ..\qtbase
     git checkout v5.6.2
-    git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff
+    git apply ../../patches/qtbase_5_6_2.diff
     cd ..
 
     configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\inc32" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\out32.dbg\ssleay32.lib %cd%\..\openssl\out32.dbg\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\out32\ssleay32.lib %cd%\..\openssl\out32\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
diff --git a/docs/building-xcode.md b/docs/building-xcode.md
index c96c0bb87..a0b09c1d8 100644
--- a/docs/building-xcode.md
+++ b/docs/building-xcode.md
@@ -30,6 +30,7 @@ Go to ***BuildPath*** and run
 
     cd Libraries
 
+    git clone https://github.com/desktop-app/patches.git
     git clone --branch 0.9.1 https://github.com/ericniebler/range-v3
 
     cd xz-5.0.5
@@ -192,8 +193,8 @@ Go to ***BuildPath*** and run
     git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
     export PATH="$PWD/depot_tools:$PATH"
     cd gyp
-    git checkout 702ac58e47
-    git apply ../../tdesktop/Telegram/Patches/gyp.diff
+    git checkout 9f2a7bb1
+    git apply ../patches/gyp.diff
     ./setup.py build
     sudo ./setup.py install
     cd ..
@@ -223,7 +224,7 @@ Go to ***BuildPath*** and run
     perl init-repository --module-subset=qtbase,qtimageformats
     git checkout v5.6.2
     cd qtimageformats && git checkout v5.6.2 && cd ..
-    cd qtbase && git checkout v5.6.2 && git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff && cd ..
+    cd qtbase && git checkout v5.6.2 && git apply ../../patches/qtbase_5_6_2.diff && cd ..
 
     ./configure -prefix "/usr/local/desktop-app/Qt-5.6.2" -debug-and-release -force-debug-info -opensource -confirm-license -static -opengl desktop -no-openssl -securetransport -nomake examples -nomake tests -platform macx-clang
     make $MAKE_THREADS_CNT