From 5116f6efd12d4bda005d5ec50181bc21ed36659d Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 20 Sep 2010 07:35:47 +0000 Subject: Fix irritating bug where desktop icons do not align to grid on startup when align to grid is selected for the desktop view git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1177325 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdesktop/kdiconview.cc | 8 ++++++-- kdesktop/kdiconview.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'kdesktop') diff --git a/kdesktop/kdiconview.cc b/kdesktop/kdiconview.cc index 75e8d10a7..e3b005b73 100644 --- a/kdesktop/kdiconview.cc +++ b/kdesktop/kdiconview.cc @@ -147,7 +147,8 @@ KDIconView::KDIconView( TQWidget *parent, const char* name ) m_eSortCriterion( NameCaseInsensitive ), m_bSortDirectoriesFirst( true ), m_itemsAlwaysFirst(), - m_gotIconsArea(false) + m_gotIconsArea(false), + m_needDesktopAlign(true) { setResizeMode( Fixed ); setIconArea( desktopRect() ); // the default is the whole desktop @@ -1493,7 +1494,10 @@ void KDIconView::updateWorkArea( const TQRect &wr ) { m_gotIconsArea = true; // now we have it! - if ( iconArea() == wr ) return; // nothing changed; avoid repaint/saveIconPosition ... + if (( iconArea() == wr ) && (m_needDesktopAlign == false)) return; // nothing changed; avoid repaint/saveIconPosition ... + + m_needDesktopAlign = false; + lineupIcons(); TQRect oldArea = iconArea(); setIconArea( wr ); diff --git a/kdesktop/kdiconview.h b/kdesktop/kdiconview.h index 5ef349322..73b493120 100644 --- a/kdesktop/kdiconview.h +++ b/kdesktop/kdiconview.h @@ -258,6 +258,8 @@ private: // did we already get the correct desktopIconsArea (from kicker) // needed when we want to line up icons on a grid bool m_gotIconsArea; + + bool m_needDesktopAlign; }; #endif -- cgit v1.2.1