From 4d21a120d2478b8d0abe7ecaf9a688f2aa88c049 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 7 Oct 2014 21:52:26 -0500 Subject: Commit the following patch from Bug 1499: tdebase: fix kdesktop resize bug --- kdesktop/bgmanager.cc | 19 ++++++++++++++----- kdesktop/bgmanager.h | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/kdesktop/bgmanager.cc b/kdesktop/bgmanager.cc index 32f774357..4b3bca252 100644 --- a/kdesktop/bgmanager.cc +++ b/kdesktop/bgmanager.cc @@ -118,6 +118,7 @@ KBackgroundManager::KBackgroundManager(TQWidget *desktop, KWinModule* twinModule /*CrossFade's config*/ m_crossTimer = new TQTimer(this); connect(m_crossTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotCrossFadeTimeout())); + resizingDesktop = true; /*Ends here*/ @@ -351,6 +352,7 @@ void KBackgroundManager::slotChangeNumberOfDesktops(int num) */ void KBackgroundManager::slotChangeDesktop(int desk) { + resizingDesktop = true; TQSize s(m_pKwinmodule->numberOfViewports(m_pKwinmodule->currentDesktop())); m_numberOfViewports = s.width() * s.height(); if (m_numberOfViewports < 1) { @@ -631,11 +633,11 @@ void KBackgroundManager::slotImageDone(int desk) m_numberOfViewports = 1; t_useViewports = 0; } - + KPixmap *pm = new KPixmap(); KVirtualBGRenderer *r = m_Renderer[desk]; bool do_cleanup = true; - fadeDesk = desk; + fadeDesk = desk; mAlpha = 1.0; int width,height; @@ -646,7 +648,7 @@ void KBackgroundManager::slotImageDone(int desk) if (current) { //START - if (m_Renderer[effectiveDesktop()]->renderer(0)->crossFadeBg() && !m_Renderer[effectiveDesktop()]->renderer(0)->usingCrossXml()){ + if (m_Renderer[effectiveDesktop()]->renderer(0)->crossFadeBg() && !m_Renderer[effectiveDesktop()]->renderer(0)->usingCrossXml() && !resizingDesktop) { int mode = m_Renderer[effectiveDesktop()]->renderer(0)->wallpaperMode(); width = TQApplication::desktop()->screenGeometry().width(); height = TQApplication::desktop()->screenGeometry().height(); @@ -654,7 +656,7 @@ void KBackgroundManager::slotImageDone(int desk) if (mode == KBackgroundSettings::NoWallpaper || mode == KBackgroundSettings::Tiled || mode == KBackgroundSettings::CenterTiled ){ mNextScreen = TQPixmap(width,height); TQPainter p (&mNextScreen); - p.drawTiledPixmap(0,0,width,height,*pm); + p.drawTiledPixmap(0,0,width,height,*pm); } else { mNextScreen = TQPixmap(*pm); } @@ -700,6 +702,8 @@ void KBackgroundManager::slotImageDone(int desk) r->saveCacheFile(); r->cleanup(); } + + resizingDesktop = false; } @@ -1004,6 +1008,7 @@ void KBackgroundManager::repaintBackground() void KBackgroundManager::desktopResized() { + resizingDesktop = true; for (unsigned i=0; iresize( kapp->desktop()->geometry().size()); + if (m_Renderer[effectiveDesktop()]->renderer(0)->usingCrossXml()){ + m_Renderer[effectiveDesktop()]->renderer(0)->changeWallpaper(); + } + } // Repaint desktop slotChangeDesktop(0); repaintBackground(); diff --git a/kdesktop/bgmanager.h b/kdesktop/bgmanager.h index 71ca6c1bb..43e57a372 100644 --- a/kdesktop/bgmanager.h +++ b/kdesktop/bgmanager.h @@ -142,6 +142,7 @@ private: int fadeDesk; TQTime mBenchmark; bool crossInit; + bool resizingDesktop; // is True if desktop is resizing }; #endif // __BGMANAGER_H__ -- cgit v1.2.1