On Wednesday, December 11, 2013 15:57:28 Nowardev-Team wrote:
> var activity   = new Activity("folderview")
> activity.name = i18n("Mac Activity”)
> activity.wallpaperPlugin = "image"
> activity.wallpaperMode = "SingleImage"
> activity.currentConfigGroup = Array("Wallpaper", "image")

hm.. does the attached patch help at all?

what is happening on containment creation is that setting the wallpaper “too 
soon" results in the Image plugin using an incorrect final resolution for the 
wallpaper. the wallpaper package itself will pick up the change, but the Image 
plugin won’t react unless a re-init is forced because it doesn’t actually hold 
on to the package, it creates it and then discards it.

this is probably better in the common case (as sizes aren’t usually changing 
constantly, so no need to hang out to another QObject in memory), but causes 
an issue here.

the patch is pretty simple and applies to kde-workspace.

looking at the code in master, it probably doesn’t have this issue as it does 
hold on to the package and react to rendering changes in the plugin. iow, it’s 
a little bit cleaner :)

anyways, if you could test with this and let me know how it goes, that’d be 
appreciated :)

-- 
Aaron J. Seigo
diff --git a/plasma/generic/wallpapers/image/image.cpp b/plasma/generic/wallpapers/image/image.cpp
index 317f668..66438cb 100644
--- a/plasma/generic/wallpapers/image/image.cpp
+++ b/plasma/generic/wallpapers/image/image.cpp
@@ -324,7 +324,12 @@ void Image::paint(QPainter *painter, const QRectF& exposedRect)
         calculateGeometry();
         if (!m_size.isEmpty() && !m_img.isEmpty()) { // We have previous image
             painter->fillRect(exposedRect, QBrush(m_color));
-            renderWallpaper();
+            if (m_mode == "SingleImage") {
+                // make sure we pick the best size wallpaper for the new size
+                setSingleImage();
+            } else {
+                renderWallpaper();
+            }
             //kDebug() << "re-rendering";
             return;
         }
@@ -817,12 +822,12 @@ void Image::renderWallpaper(const QString& image)
 
 void Image::pathCreated(const QString &path)
 {
-    if(!m_slideshowBackgrounds.contains(path)) {
+    if (!m_slideshowBackgrounds.contains(path)) {
         QFileInfo fileInfo(path);
-        if(fileInfo.isFile() && BackgroundFinder::suffixes().contains(fileInfo.suffix().toLower())) {
+        if (fileInfo.isFile() && BackgroundFinder::suffixes().contains(fileInfo.suffix().toLower())) {
             m_slideshowBackgrounds.append(path);
             m_unseenSlideshowBackgrounds.append(path);
-            if(m_slideshowBackgrounds.count() == 1) {
+            if (m_slideshowBackgrounds.count() == 1) {
                 nextSlide();
             }
         }
@@ -831,16 +836,16 @@ void Image::pathCreated(const QString &path)
 
 void Image::pathDirty(const QString &path)
 {
-    if(path == m_img) {
+    if (path == m_img) {
         renderWallpaper(path);
     }
 }
 
 void Image::pathDeleted(const QString &path)
 {
-    if(m_slideshowBackgrounds.removeAll(path)) {
+    if (m_slideshowBackgrounds.removeAll(path)) {
         m_unseenSlideshowBackgrounds.removeAll(path);
-        if(path == m_img) {
+        if (path == m_img) {
             nextSlide();
         }
     }
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to