mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-27 14:50:21 +03:00
enable Plasma VirtualDesktopManagement
This commit is contained in:
parent
11550cd36d
commit
e2f4122a95
@ -328,7 +328,7 @@ void Corona::setupWaylandIntegration()
|
||||
wI->initWindowManagement(pwm);
|
||||
}
|
||||
});
|
||||
/*
|
||||
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
QObject::connect(registry, &KWayland::Client::Registry::plasmaVirtualDesktopManagementAnnounced,
|
||||
[this, registry] (quint32 name, quint32 version) {
|
||||
@ -341,7 +341,7 @@ void Corona::setupWaylandIntegration()
|
||||
}
|
||||
});
|
||||
#endif
|
||||
*/
|
||||
|
||||
registry->setup();
|
||||
connection->roundtrip();
|
||||
}
|
||||
|
@ -855,18 +855,14 @@ void Positioner::updatePosition(QRect availableScreenRect)
|
||||
}
|
||||
}
|
||||
|
||||
auto layerWindow = LayerShellQt::Window::get(m_view);
|
||||
layerWindow->setAnchors(LayerShellQt::Window::AnchorBottom);
|
||||
layerWindow->setLayer(LayerShellQt::Window::LayerTop);
|
||||
layerWindow->setMargins({0, 100, 0, 0});
|
||||
|
||||
qDebug() << "org.kde.layer ::: " << layerWindow->anchors() << " __ " << layerWindow->layer() << " :: " << m_validGeometry;
|
||||
if (KWindowSystem::isPlatformWayland()) {
|
||||
auto layerWindow = LayerShellQt::Window::get(m_view);
|
||||
layerWindow->setAnchors(LayerShellQt::Window::AnchorBottom);
|
||||
layerWindow->setLayer(LayerShellQt::Window::LayerTop);
|
||||
qDebug() << "org.kde.layer ::: " << layerWindow->anchors() << " __ " << layerWindow->layer() << " :: " << m_validGeometry;
|
||||
}
|
||||
|
||||
m_view->setPosition(position);
|
||||
|
||||
//if (m_view->surface()) {
|
||||
// m_view->surface()->setPosition(position);
|
||||
// }
|
||||
}
|
||||
|
||||
int Positioner::slideOffset() const
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
//#include <KWayland/Client/plasmavirtualdesktop.h>
|
||||
#include <KWayland/Client/plasmavirtualdesktop.h>
|
||||
#endif
|
||||
|
||||
// X11
|
||||
@ -151,7 +151,7 @@ void WaylandInterface::initWindowManagement(KWayland::Client::PlasmaWindowManage
|
||||
}
|
||||
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
/*void WaylandInterface::initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement)
|
||||
void WaylandInterface::initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement)
|
||||
{
|
||||
if (m_virtualDesktopManagement == virtualDesktopManagement) {
|
||||
return;
|
||||
@ -172,11 +172,11 @@ void WaylandInterface::initWindowManagement(KWayland::Client::PlasmaWindowManage
|
||||
setCurrentDesktop(QString());
|
||||
}
|
||||
});
|
||||
}*/
|
||||
}
|
||||
|
||||
void WaylandInterface::addDesktop(const QString &id, quint32 position)
|
||||
{
|
||||
/* if (m_desktops.contains(id)) {
|
||||
if (m_desktops.contains(id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ void WaylandInterface::addDesktop(const QString &id, quint32 position)
|
||||
|
||||
if (desktop->isActive()) {
|
||||
setCurrentDesktop(id);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
void WaylandInterface::setCurrentDesktop(QString desktop)
|
||||
@ -319,7 +319,7 @@ void WaylandInterface::setViewStruts(QWindow &view, const QRect &rect, Plasma::T
|
||||
void WaylandInterface::switchToNextVirtualDesktop()
|
||||
{
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
/* if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
|
||||
if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -338,14 +338,14 @@ void WaylandInterface::switchToNextVirtualDesktop()
|
||||
|
||||
if (desktopObj) {
|
||||
desktopObj->requestActivate();
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void WaylandInterface::switchToPreviousVirtualDesktop()
|
||||
{
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
/* if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
|
||||
if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ void WaylandInterface::switchToPreviousVirtualDesktop()
|
||||
|
||||
if (desktopObj) {
|
||||
desktopObj->requestActivate();
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,11 @@
|
||||
// KDE
|
||||
#include <KWindowInfo>
|
||||
#include <KWindowEffects>
|
||||
#include <KWayland/Client/plasmawindowmanagement.h>
|
||||
|
||||
#include <KWayland/Client/plasmawindowmanagement.h>
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
#include <KWayland/Client/plasmavirtualdesktop.h>
|
||||
#endif
|
||||
|
||||
namespace Latte {
|
||||
class Corona;
|
||||
@ -90,7 +93,7 @@ public:
|
||||
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
//! VirtualDesktopsSupport
|
||||
//void initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement);
|
||||
void initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement);
|
||||
#endif
|
||||
|
||||
private slots:
|
||||
@ -124,7 +127,7 @@ private:
|
||||
|
||||
#if KF5_VERSION_MINOR >= 52
|
||||
//! VirtualDesktopsSupport
|
||||
//KWayland::Client::PlasmaVirtualDesktopManagement *m_virtualDesktopManagement{nullptr};
|
||||
KWayland::Client::PlasmaVirtualDesktopManagement *m_virtualDesktopManagement{nullptr};
|
||||
QStringList m_desktops;
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user