mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-29 09:57:17 +00:00
correct desktop indices for main widget
This commit is contained in:
parent
88f70c0ea6
commit
0565d3533f
@ -46,13 +46,14 @@ QVariant DesktopSource::data(const QString &_source)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESS) << "Source" << _source;
|
qCDebug(LOG_ESS) << "Source" << _source;
|
||||||
|
|
||||||
auto increment = KWindowSystem::isPlatformX11() ? 0 : 1;
|
auto nativeIndex = m_vdi->position(m_vdi->currentDesktop());
|
||||||
auto current = m_vdi->position(m_vdi->currentDesktop()) + increment;
|
auto decrement = KWindowSystem::isPlatformX11() ? 1 : 0;
|
||||||
|
auto current = nativeIndex - decrement;
|
||||||
|
|
||||||
if (_source == "desktop/current/name") {
|
if (_source == "desktop/current/name") {
|
||||||
return m_vdi->desktopNames().at(current);
|
return m_vdi->desktopNames().at(current);
|
||||||
} else if (_source == "desktop/current/number") {
|
} else if (_source == "desktop/current/number") {
|
||||||
return current;
|
return current + 1;
|
||||||
} else if (_source == "desktop/total/name") {
|
} else if (_source == "desktop/total/name") {
|
||||||
return m_vdi->desktopNames();
|
return m_vdi->desktopNames();
|
||||||
} else if (_source == "desktop/total/number") {
|
} else if (_source == "desktop/total/number") {
|
||||||
|
Loading…
Reference in New Issue
Block a user