From kde-commits Mon Jun 08 15:00:28 2009 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Mon, 08 Jun 2009 15:00:28 +0000 To: kde-commits Subject: KDE/kdebase/workspace/plasma/applets/pager Message-Id: <1244473228.248516.14724.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=124447323815674 SVN commit 978926 by aseigo: constrain m_rows only when calculating the geometry; this prevents the situation where the pager gets started before the window manager sets up virtual desktops and therefore we get 1 for the number of desktops causing the row count to be altered prematurely M +3 -9 pager.cpp --- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.cpp #978925:978926 @@ -99,8 +99,6 @@ if (m_rows < 1) { m_rows = 1; - } else if (m_rows > m_desktopCount) { - m_rows = m_desktopCount; } m_timer = new QTimer(this); @@ -254,13 +252,13 @@ int padding = 2; // Space between miniatures of desktops int textMargin = 3; // Space between name of desktop and border - int columns = m_desktopCount / m_rows + m_desktopCount % m_rows; - int rows = m_rows; + int rows = qMax(qMin(m_rows, m_desktopCount), 1); + int columns = m_desktopCount / rows + m_desktopCount % rows; //inverse rows and columns in vertical panel if (formFactor() == Plasma::Vertical) { rows = columns; - columns = m_rows; + columns = rows; } qreal leftMargin = 0; @@ -559,10 +557,6 @@ m_dirtyDesktop = -1; m_desktopCount = num; - if (m_rows > m_desktopCount) { - m_rows = m_desktopCount; - } - m_rects.clear(); recalculateGeometry(); recalculateWindowRects();