Skip to content

Commit 0565d35

Browse files
committed
correct desktop indices for main widget
1 parent 88f70c0 commit 0565d35

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sources/extsysmonsources/desktopsource.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ QVariant DesktopSource::data(const QString &_source)
4646
{
4747
qCDebug(LOG_ESS) << "Source" << _source;
4848

49-
auto increment = KWindowSystem::isPlatformX11() ? 0 : 1;
50-
auto current = m_vdi->position(m_vdi->currentDesktop()) + increment;
49+
auto nativeIndex = m_vdi->position(m_vdi->currentDesktop());
50+
auto decrement = KWindowSystem::isPlatformX11() ? 1 : 0;
51+
auto current = nativeIndex - decrement;
5152

5253
if (_source == "desktop/current/name") {
5354
return m_vdi->desktopNames().at(current);
5455
} else if (_source == "desktop/current/number") {
55-
return current;
56+
return current + 1;
5657
} else if (_source == "desktop/total/name") {
5758
return m_vdi->desktopNames();
5859
} else if (_source == "desktop/total/number") {

0 commit comments

Comments
 (0)