wayland support

This commit is contained in:
2023-05-15 12:00:46 +03:00
parent 84de9755b5
commit dfe140ea8c
86 changed files with 514 additions and 711 deletions

View File

@ -18,7 +18,7 @@
#include "desktopsource.h"
#include <KX11Extras>
#include <taskmanager/virtualdesktopinfo.h>
#include "awdebug.h"
@ -28,12 +28,16 @@ DesktopSource::DesktopSource(QObject *_parent, const QStringList &_args)
{
Q_ASSERT(_args.count() == 0);
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
m_vdi = new TaskManager::VirtualDesktopInfo(this);
}
DesktopSource::~DesktopSource()
{
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
delete m_vdi;
}
@ -41,20 +45,16 @@ QVariant DesktopSource::data(const QString &_source)
{
qCDebug(LOG_ESS) << "Source" << _source;
int current = KX11Extras::currentDesktop();
int total = KX11Extras::numberOfDesktops();
auto current = m_vdi->position(m_vdi->currentDesktop());
if (_source == "desktop/current/name") {
return KX11Extras::desktopName(current);
return m_vdi->desktopNames().at(current);
} else if (_source == "desktop/current/number") {
return current;
} else if (_source == "desktop/total/name") {
QStringList desktops;
for (int i = 1; i < total + 1; i++)
desktops.append(KX11Extras::desktopName(i));
return desktops;
return m_vdi->desktopNames();
} else if (_source == "desktop/total/number") {
return total;
return m_vdi->numberOfDesktops();
}
return QVariant();