From 342adb4274d9c87256253d55cd7956a036a324ca Mon Sep 17 00:00:00 2001 From: Pratik Patel <69638392+pratikpatel8982@users.noreply.github.com> Date: Fri, 15 May 2026 14:40:00 +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 40cb7c2f858d3..49ae3f3e3a4b7 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 c4c4cfe15afbb..92e91268a8a3e 100644 --- a/Telegram/SourceFiles/settings/sections/settings_chat.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_chat.cpp @@ -707,7 +707,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;