diff --git a/Telegram/Patches/qtbase_5_6_2.diff b/Telegram/Patches/qtbase_5_6_2.diff index 5bd013a69..4961a5bc8 100644 --- a/Telegram/Patches/qtbase_5_6_2.diff +++ b/Telegram/Patches/qtbase_5_6_2.diff @@ -16,6 +16,25 @@ index eec9e1f..7ae53c7 100644 QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_LTCG = -GL QMAKE_CFLAGS_SSE2 = -arch:SSE2 +diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp +index 391fbcc..d07802b 100644 +--- a/src/corelib/io/qfsfileengine_win.cpp ++++ b/src/corelib/io/qfsfileengine_win.cpp +@@ -427,11 +427,12 @@ qint64 QFSFileEnginePrivate::nativeWrite(const char *data, qint64 len) + + // Writing on Windows fails with ERROR_NO_SYSTEM_RESOURCES when + // the chunks are too large, so we limit the block size to 32MB. +- const DWORD blockSize = DWORD(qMin(bytesToWrite, qint64(32 * 1024 * 1024))); + qint64 totalWritten = 0; + do { ++ // Patch: backport critical bugfix from '683c9bc4a8' commit. ++ const DWORD currentBlockSize = DWORD(qMin(bytesToWrite, qint64(32 * 1024 * 1024))); + DWORD bytesWritten; +- if (!WriteFile(fileHandle, data + totalWritten, blockSize, &bytesWritten, NULL)) { ++ if (!WriteFile(fileHandle, data + totalWritten, currentBlockSize, &bytesWritten, NULL)) { + if (totalWritten == 0) { + // Note: Only return error if the first WriteFile failed. + q->setError(QFile::WriteError, qt_error_string()); diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp index 14e4fd1..0619a17 100644 --- a/src/corelib/tools/qunicodetables.cpp diff --git a/Telegram/Resources/art/bg_initial.jpg b/Telegram/Resources/art/bg_initial.jpg new file mode 100644 index 000000000..602b52834 Binary files /dev/null and b/Telegram/Resources/art/bg_initial.jpg differ diff --git a/Telegram/Resources/art/bg_initial.png b/Telegram/Resources/art/bg_initial.png deleted file mode 100644 index 8c5073a61..000000000 Binary files a/Telegram/Resources/art/bg_initial.png and /dev/null differ diff --git a/Telegram/Resources/telegram.qrc b/Telegram/Resources/telegram.qrc index 6fece6a45..e1db7041b 100644 --- a/Telegram/Resources/telegram.qrc +++ b/Telegram/Resources/telegram.qrc @@ -5,7 +5,7 @@ art/fonts/OpenSans-Semibold.ttf art/newmsg.wav art/bg.jpg - art/bg_initial.png + art/bg_initial.jpg art/icon256.png art/iconbig256.png art/sunrise.jpg diff --git a/Telegram/SourceFiles/boxes/backgroundbox.cpp b/Telegram/SourceFiles/boxes/backgroundbox.cpp index 6a3e2d5a9..f60637249 100644 --- a/Telegram/SourceFiles/boxes/backgroundbox.cpp +++ b/Telegram/SourceFiles/boxes/backgroundbox.cpp @@ -76,7 +76,7 @@ BackgroundBox::Inner::Inner(QWidget *parent) : TWidget(parent) void BackgroundBox::Inner::gotWallpapers(const MTPVector &result) { App::WallPapers wallpapers; - auto oldBackground = ImagePtr(qsl(":/gui/art/bg_initial.png")); + auto oldBackground = ImagePtr(qsl(":/gui/art/bg_initial.jpg")); wallpapers.push_back(App::WallPaper(Window::Theme::kInitialBackground, oldBackground, oldBackground)); auto &v = result.c_vector().v; for_const (auto &w, v) { diff --git a/Telegram/SourceFiles/window/window_theme.cpp b/Telegram/SourceFiles/window/window_theme.cpp index ff14508c5..a9c9cb016 100644 --- a/Telegram/SourceFiles/window/window_theme.cpp +++ b/Telegram/SourceFiles/window/window_theme.cpp @@ -400,7 +400,7 @@ void ChatBackground::setImage(int32 id, QImage &&image) { setPreparedImage(std_::move(image)); } else { if (_id == kInitialBackground) { - image.load(qsl(":/gui/art/bg_initial.png")); + image.load(qsl(":/gui/art/bg_initial.jpg")); if (cRetina()) { image = image.scaledToWidth(image.width() * 2, Qt::SmoothTransformation); } else if (cScale() != dbisOne) {