From 13efbfca67f8270458d103e128ba76525f663329 Mon Sep 17 00:00:00 2001 From: Konrad Materka Date: Thu, 10 Oct 2019 08:36:19 -0600 Subject: [PATCH] [XembedSNIProxy] Scale only big icons Summary: Do not scale up small icons to avoid quality detoriation. For small icons scaling should be done in SystemTray only. Currently XembedSNIProxy scales to 32x32, then SystemTray (usually) scales it down to 24x24. BUG: 366047 FIXED-IN: 5.17.1 Test Plan: I've run few applications with small icons: - keepassx (22x22) - liferea (16x16) - tuxguitar (16x16) It looks much better without scaling in xemebdsniproxy. Reviewers: davidedmundson, #plasma, #plasma_workspaces Reviewed By: davidedmundson, #plasma, #plasma_workspaces Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D24531 --- xembed-sni-proxy/sniproxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index 306b7b15f..102a9a622 100644 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -206,7 +206,7 @@ void SNIProxy::update() int h = image.height(); m_pixmap = QPixmap::fromImage(image); - if (w != s_embedSize || h != s_embedSize) { + if (w > s_embedSize || h > s_embedSize) { qCDebug(SNIPROXY) << "Scaling pixmap of window" << m_windowId << Title() << "from w*h" << w << h; m_pixmap = m_pixmap.scaled(s_embedSize, s_embedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); }