2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

dont cache default background image, cmd+m minimizes window in os x

This commit is contained in:
John Preston
2015-04-16 14:14:25 +03:00
parent 34d5c3777b
commit a356a4dc06
5 changed files with 21 additions and 3 deletions

View File

@@ -1808,16 +1808,22 @@ namespace App {
if (Local::readBackground()) return;
QImage img(p);
bool remove = false;
if (p.isNull()) {
img.load(st::msgBG);
id = 0;
remove = true;
}
if (img.format() != QImage::Format_ARGB32 && img.format() != QImage::Format_ARGB32_Premultiplied && img.format() != QImage::Format_RGB32) {
img = img.convertToFormat(QImage::Format_RGB32);
}
img.setDevicePixelRatio(cRetinaFactor());
if (!nowrite) Local::writeBackground(id, img);
if (remove) {
Local::writeBackground(0, QImage());
} else if (!nowrite) {
Local::writeBackground(id, img);
}
delete cChatBackground();
cSetChatBackground(new QPixmap(QPixmap::fromImage(img, Qt::ColorOnly)));