From eaf432c1f4828a0d6dd68c0096ff9cf32d0a2ebc Mon Sep 17 00:00:00 2001 From: Pratik Patel Date: Fri, 15 May 2026 12:08:17 +0530 Subject: [PATCH] fix: preserve PNG transparency in chat wallpapers Remove .forceOpaque = true from ChooseFromFile in settings_chat.cpp and BackgroundBox::chooseFromFile in background_box.cpp, which was compositing transparent pixels against white via Opaque() for all non-JPEG files before the image reached the wallpaper pipeline. --- Telegram/SourceFiles/boxes/background_box.cpp | 2 +- Telegram/SourceFiles/settings/sections/settings_chat.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/boxes/background_box.cpp b/Telegram/SourceFiles/boxes/background_box.cpp index 40cb7c2f858d3e..49ae3f3e3a4b70 100644 --- a/Telegram/SourceFiles/boxes/background_box.cpp +++ b/Telegram/SourceFiles/boxes/background_box.cpp @@ -250,7 +250,7 @@ void BackgroundBox::chooseFromFile() { auto image = Images::Read({ .path = result.paths.isEmpty() ? QString() : result.paths.front(), .content = result.remoteContent, - .forceOpaque = true, + .forceOpaque = false, }).image; if (image.isNull() || image.width() <= 0 || image.height() <= 0) { return; diff --git a/Telegram/SourceFiles/settings/sections/settings_chat.cpp b/Telegram/SourceFiles/settings/sections/settings_chat.cpp index b39633148a7ec7..c4e482ce224c47 100644 --- a/Telegram/SourceFiles/settings/sections/settings_chat.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_chat.cpp @@ -716,7 +716,7 @@ void ChooseFromFile( auto image = Images::Read({ .path = result.paths.isEmpty() ? QString() : result.paths.front(), .content = result.remoteContent, - .forceOpaque = true, + .forceOpaque = false, }).image; if (image.isNull() || image.width() <= 0 || image.height() <= 0) { return;