From 2897d7b5e6ee1f3822a864fed137682d35ebd646b64be7b229f915bfd770660c Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sat, 12 Dec 2015 20:32:40 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=148 --- kde355684.patch | 98 +++++++++++++++++++++++++++++++++++++++ plasma5-workspace.changes | 1 + plasma5-workspace.spec | 2 + 3 files changed, 101 insertions(+) create mode 100644 kde355684.patch diff --git a/kde355684.patch b/kde355684.patch new file mode 100644 index 0000000..45f597d --- /dev/null +++ b/kde355684.patch @@ -0,0 +1,98 @@ +diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp +index ca2667f..0b7c072 100644 +--- a/xembed-sni-proxy/sniproxy.cpp ++++ b/xembed-sni-proxy/sniproxy.cpp +@@ -191,6 +191,10 @@ SNIProxy::~SNIProxy() + void SNIProxy::update() + { + const QImage image = getImageNonComposite(); ++ if (image.isNull()) { ++ qCDebug(SNIPROXY) << "No xembed icon for" << m_windowId << Title(); ++ return; ++ } + + int w = image.width(); + int h = image.height(); +@@ -240,11 +244,61 @@ QImage SNIProxy::getImageNonComposite() + + xcb_image_t *image = xcb_image_get(c, m_windowId, 0, 0, geom->width, geom->height, 0xFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP); + +- QImage qimage(image->data, image->width, image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, image); ++ QImage qimage(convertFromNative(image)); + + return qimage; + } + ++QImage SNIProxy::convertFromNative(xcb_image_t *xcbImage) ++{ ++ QImage::Format format = QImage::Format_Invalid; ++ ++ switch (xcbImage->depth) { ++ case 1: ++ format = QImage::Format_MonoLSB; ++ break; ++ case 16: ++ format = QImage::Format_RGB16; ++ break; ++ case 24: ++ format = QImage::Format_RGB32; ++ break; ++ case 30: { ++ // Qt doesn't have a matching image format. We need to convert manually ++ quint32 *pixels = reinterpret_cast(xcbImage->data); ++ for (uint i = 0; i < (xcbImage->size / 4); i++) { ++ int r = (pixels[i] >> 22) & 0xff; ++ int g = (pixels[i] >> 12) & 0xff; ++ int b = (pixels[i] >> 2) & 0xff; ++ ++ pixels[i] = qRgba(r, g, b, 0xff); ++ } ++ // fall through, Qt format is still Format_ARGB32_Premultiplied ++ } ++ case 32: ++ format = QImage::Format_ARGB32_Premultiplied; ++ break; ++ default: ++ return QImage(); // we don't know ++ } ++ ++ //QImage image(xcbImage->data, xcbImage->width, xcbImage->height, format); ++ QImage image(xcbImage->data, xcbImage->width, xcbImage->height, xcbImage->stride, format, sni_cleanup_xcb_image, xcbImage); ++ ++ if (image.isNull()) { ++ return QImage(); ++ } ++ ++ // work around an abort in QImage::color ++ if (image.format() == QImage::Format_MonoLSB) { ++ image.setColorCount(2); ++ image.setColor(0, QColor(Qt::white).rgb()); ++ image.setColor(1, QColor(Qt::black).rgb()); ++ } ++ ++ return image; ++} ++ + //____________properties__________ + + QString SNIProxy::Category() const +diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h +index 29aa56e..89746a7 100644 +--- a/xembed-sni-proxy/sniproxy.h ++++ b/xembed-sni-proxy/sniproxy.h +@@ -28,6 +28,7 @@ + #include + + #include ++#include + + #include "snidbus.h" + +@@ -141,6 +142,7 @@ Q_SIGNALS: + private: + void sendClick(uint8_t mouseButton, int x, int y); + QImage getImageNonComposite(); ++ QImage convertFromNative(xcb_image_t *xcbImage); + + QDBusConnection m_dbus; + xcb_window_t m_windowId; diff --git a/plasma5-workspace.changes b/plasma5-workspace.changes index 40aa633..9ab5d3d 100644 --- a/plasma5-workspace.changes +++ b/plasma5-workspace.changes @@ -12,6 +12,7 @@ Sat Dec 12 17:32:52 UTC 2015 - hrvoje.senjan@gmail.com 0003-Make-comment-section-of-the-timezones-configuration-.patch 0004-notifications-Fix-default-notification-position-sett.patch 0001-Forward-mouse-enter-and-leave-events-on-feathered-ed.patch + kde355684.patch ------------------------------------------------------------------- Fri Dec 4 12:02:33 UTC 2015 - alarrosa@suse.com diff --git a/plasma5-workspace.spec b/plasma5-workspace.spec index 40c3135..4147eee 100644 --- a/plasma5-workspace.spec +++ b/plasma5-workspace.spec @@ -39,6 +39,7 @@ Patch101: 0001-notifications-Check-if-the-popup-is-visible-before-u.patch Patch102: 0002-notifications-Move-reading-globalConfig-from-ctor-to.patch Patch103: 0003-Make-comment-section-of-the-timezones-configuration-.patch Patch104: 0004-notifications-Fix-default-notification-position-sett.patch +Patch105: kde355684.patch # PATCHES 201-300 and above are from upstream master/5.6 branch BuildRequires: kf5-filesystem BuildRequires: update-desktop-files @@ -212,6 +213,7 @@ workspace. Development files. %patch102 -p1 %patch103 -p1 %patch104 -p1 +%patch105 -p1 %build %cmake_kf5 -d build -- -DKDE4_COMMON_PAM_SERVICE=xdm -DKDE_DEFAULT_HOME=.kde4 -DCMAKE_INSTALL_LOCALEDIR=share/locale/kf5