wayland:remove/disable Plasma specific surface code

work/m_layershell
Michail Vourlakos 3 years ago
parent ce15e4e511
commit cdfbe6ecd1

@ -23,6 +23,8 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Activities Archive CoreAddons GuiAddons Crash DBusAddons Declarative GlobalAccel Kirigami2
I18n IconThemes KIO NewStuff Notifications Plasma PlasmaQuick Wayland WindowSystem XmlGui)
find_package(LayerShellQt REQUIRED)
find_package(X11 REQUIRED)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
URL "http://www.x.org"

@ -101,6 +101,7 @@ else()
KF5::PlasmaQuick
KF5::WaylandClient
KF5::XmlGui
LayerShellQt::Interface
)
endif()

@ -22,8 +22,6 @@
#include <KLocalizedContext>
#include <KDeclarative/KDeclarative>
#include <KWindowSystem>
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
// Plasma
#include <Plasma/Package>
@ -66,11 +64,6 @@ InfoView::~InfoView()
PanelShadows::self()->removeWindow(this);
qDebug() << "InfoView deleting ...";
if (m_shellSurface) {
delete m_shellSurface;
m_shellSurface = nullptr;
}
}
void InfoView::init()
@ -123,10 +116,6 @@ void InfoView::syncGeometry()
QPoint position{sGeometry.center().x() - size.width() / 2, sGeometry.center().y() - size.height() / 2 };
setPosition(position);
if (m_shellSurface) {
m_shellSurface->setPosition(position);
}
}
void InfoView::showEvent(QShowEvent *ev)
@ -162,7 +151,7 @@ void InfoView::updateWaylandId()
void InfoView::setupWaylandIntegration()
{
if (m_shellSurface) {
/* if (m_shellSurface) {
// already setup
return;
}
@ -185,12 +174,12 @@ void InfoView::setupWaylandIntegration()
m_shellSurface = interface->createSurface(s, this);
m_corona->wm()->setViewExtraFlags(m_shellSurface);
}
}*/
}
bool InfoView::event(QEvent *e)
{
if (e->type() == QEvent::PlatformSurface) {
/* if (e->type() == QEvent::PlatformSurface) {
if (auto pe = dynamic_cast<QPlatformSurfaceEvent *>(e)) {
switch (pe->surfaceEventType()) {
case QPlatformSurfaceEvent::SurfaceCreated:
@ -212,7 +201,7 @@ bool InfoView::event(QEvent *e)
break;
}
}
}
}*/
return QQuickWindow::event(e);
}

@ -17,11 +17,6 @@
#include <QQuickView>
#include <QScreen>
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
@ -68,7 +63,6 @@ private:
Plasma::FrameSvg::EnabledBorders m_borders{Plasma::FrameSvg::TopBorder | Plasma::FrameSvg::BottomBorder};
Latte::WindowSystem::WindowId m_trackedWindowId;
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
Latte::Corona *m_corona{nullptr};
};

@ -76,9 +76,10 @@
#include <KWindowSystem>
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/registry.h>
#include <KWayland/Client/plasmashell.h>
//#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/plasmawindowmanagement.h>
namespace Latte {
Corona::Corona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp, QString addViewTemplateName, int userSetMemoryUsage, QObject *parent)
@ -312,10 +313,10 @@ void Corona::setupWaylandIntegration()
Registry *registry{new Registry(this)};
registry->create(connection);
connect(registry, &Registry::plasmaShellAnnounced, this
/* connect(registry, &Registry::plasmaShellAnnounced, this
, [this, registry](quint32 name, quint32 version) {
m_waylandCorona = registry->createPlasmaShell(name, version, this);
});
});*/
QObject::connect(registry, &KWayland::Client::Registry::plasmaWindowManagementAnnounced,
[this, registry](quint32 name, quint32 version) {
@ -327,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) {
@ -340,16 +341,11 @@ void Corona::setupWaylandIntegration()
}
});
#endif
*/
registry->setup();
connection->roundtrip();
}
KWayland::Client::PlasmaShell *Corona::waylandCoronaInterface() const
{
return m_waylandCorona;
}
void Corona::cleanConfig()
{
auto containmentsEntries = config()->group("Containments");

@ -42,12 +42,6 @@ namespace KActivities {
class Consumer;
}
namespace KWayland {
namespace Client {
class PlasmaShell;
}
}
namespace Latte {
class CentralLayout;
class ScreenPool;
@ -119,8 +113,6 @@ public:
int screenForContainment(const Plasma::Containment *containment) const override;
KWayland::Client::PlasmaShell *waylandCoronaInterface() const;
KActivities::Consumer *activitiesConsumer() const;
GlobalShortcuts *globalShortcuts() const;
ScreenPool *screenPool() const;
@ -250,8 +242,6 @@ private:
PanelShadows *m_dialogShadows{nullptr};
KWayland::Client::PlasmaShell *m_waylandCorona{nullptr};
friend class GlobalShortcuts;
friend class Layouts::Manager;
friend class Layouts::Storage;

@ -35,6 +35,7 @@
#include <KAboutData>
#include <KDBusService>
#include <KQuickAddons/QtQuickSettings>
#include <LayerShellQt/Shell>
//! COLORS
#define CNORMAL "\e[0m"
@ -68,6 +69,10 @@ int main(int argc, char **argv)
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
}
const QByteArray oldShellIntegration = qgetenv("QT_WAYLAND_SHELL_INTEGRATION");
LayerShellQt::Shell::useLayerShell();
QQuickWindow::setDefaultAlphaBuffer(true);
const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM");
@ -420,6 +425,9 @@ int main(int argc, char **argv)
Latte::Corona corona(defaultLayoutOnStartup, layoutNameOnStartup, addViewTemplateNameOnStartup, memoryUsage);
KDBusService service(KDBusService::Unique);
qDebug() << oldShellIntegration;
qputenv("QT_WAYLAND_SHELL_INTEGRATION", oldShellIntegration);
return app.exec();
}

@ -545,9 +545,9 @@ void Effects::updateEffects()
{
//! Don't apply any effect before the wayland surface is created under wayland
//! https://bugs.kde.org/show_bug.cgi?id=392890
if (KWindowSystem::isPlatformWayland() && !m_view->surface()) {
return;
}
// if (KWindowSystem::isPlatformWayland() && !m_view->surface()) {
// return;
// }
bool clearEffects{true};

@ -16,8 +16,6 @@
#include <QTimer>
// KDE
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
#include <KWindowSystem>
// X11
@ -139,10 +137,6 @@ SubWindow::~SubWindow()
for (auto &c : connectionsHack) {
disconnect(c);
}
if (m_shellSurface) {
delete m_shellSurface;
}
}
int SubWindow::location()
@ -179,11 +173,6 @@ Latte::WindowSystem::WindowId SubWindow::trackedWindowId()
return m_trackedWindowId;
}
KWayland::Client::PlasmaShellSurface *SubWindow::surface()
{
return m_shellSurface;
}
void SubWindow::fixGeometry()
{
if (!m_calculatedGeometry.isEmpty()
@ -193,10 +182,6 @@ void SubWindow::fixGeometry()
setMaximumSize(m_calculatedGeometry.size());
resize(m_calculatedGeometry.size());
setPosition(m_calculatedGeometry.x(), m_calculatedGeometry.y());
if (m_shellSurface) {
m_shellSurface->setPosition(m_calculatedGeometry.topLeft());
}
}
}
@ -221,7 +206,7 @@ void SubWindow::startGeometryTimer()
void SubWindow::setupWaylandIntegration()
{
if (m_shellSurface || !KWindowSystem::isPlatformWayland() || !m_latteView || !m_latteView->containment()) {
/* if (m_shellSurface || !KWindowSystem::isPlatformWayland() || !m_latteView || !m_latteView->containment()) {
// already setup
return;
}
@ -246,7 +231,7 @@ void SubWindow::setupWaylandIntegration()
m_corona->wm()->setViewExtraFlags(m_shellSurface);
m_shellSurface->setPanelTakesFocus(false);
}
}*/
}
bool SubWindow::event(QEvent *e)

@ -15,11 +15,6 @@
#include <QQuickView>
#include <QTimer>
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
class Corona;
@ -52,8 +47,6 @@ public:
Latte::View *parentView();
Latte::WindowSystem::WindowId trackedWindowId();
KWayland::Client::PlasmaShellSurface *surface();
signals:
void forcedShown(); //[workaround] forced shown to avoid a KWin issue that hides windows when activities are stopped
void calculatedGeometryChanged();
@ -105,7 +98,6 @@ protected:
QPointer<Latte::Corona> m_corona;
Latte::WindowSystem::WindowId m_trackedWindowId;
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
};
}

@ -856,9 +856,9 @@ void Positioner::updatePosition(QRect availableScreenRect)
m_view->setPosition(position);
if (m_view->surface()) {
m_view->surface()->setPosition(position);
}
//if (m_view->surface()) {
// m_view->surface()->setPosition(position);
// }
}
int Positioner::slideOffset() const

@ -19,7 +19,6 @@
// KDE
#include <KWindowSystem>
#include <KWayland/Client/plasmashell.h>
// Plasma
#include <Plasma/Package>
@ -87,10 +86,6 @@ void CanvasConfigView::syncGeometry()
setPosition(geometry.topLeft());
if (m_shellSurface) {
m_shellSurface->setPosition(geometry.topLeft());
}
setMaximumSize(geometry.size());
setMinimumSize(geometry.size());
resize(geometry.size());
@ -135,11 +130,6 @@ bool CanvasConfigView::event(QEvent *e)
void CanvasConfigView::showEvent(QShowEvent *ev)
{
if (m_shellSurface) {
//! under wayland it needs to be set again after its hiding
m_shellSurface->setPosition(m_geometryWhenVisible.topLeft());
}
SubConfigView::showEvent(ev);
if (!m_latteView) {
@ -189,7 +179,7 @@ void CanvasConfigView::focusOutEvent(QFocusEvent *ev)
void CanvasConfigView::hideConfigWindow()
{
if (m_shellSurface) {
if (KWindowSystem::isPlatformWayland()) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {

@ -27,12 +27,6 @@ class FrameSvg;
class Types;
}
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
class Corona;
class View;

@ -30,8 +30,6 @@
// KDE
#include <KLocalizedContext>
#include <KDeclarative/KDeclarative>
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
#include <KWindowEffects>
#include <KWindowSystem>
@ -136,7 +134,7 @@ void PrimaryConfigView::requestActivate()
if (m_latteView && m_latteView->visibility()) {
if (KWindowSystem::isPlatformX11()) {
m_latteView->visibility()->setViewOnFrontLayer();
} else if (m_shellSurface) {
} else if (KWindowSystem::isPlatformWayland()) {
m_corona->wm()->requestActivate(m_latteView->positioner()->trackedWindowId());
}
}
@ -165,7 +163,7 @@ void PrimaryConfigView::showConfigWindow()
void PrimaryConfigView::hideConfigWindow()
{
if (m_shellSurface) {
if (KWindowSystem::isPlatformWayland()) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {
@ -403,10 +401,6 @@ void PrimaryConfigView::syncGeometry()
setPosition(position);
if (m_shellSurface) {
m_shellSurface->setPosition(position);
}
setMaximumSize(size);
setMinimumSize(size);
resize(size);
@ -418,11 +412,6 @@ void PrimaryConfigView::showEvent(QShowEvent *ev)
{
updateAvailableScreenGeometry();
if (m_shellSurface) {
//! under wayland it needs to be set again after its hiding
m_shellSurface->setPosition(m_geometryWhenVisible.topLeft());
}
SubConfigView::showEvent(ev);
if (!m_latteView) {
@ -637,12 +626,6 @@ void PrimaryConfigView::updateEnabledBorders()
void PrimaryConfigView::updateEffects()
{
//! Don't apply any effect before the wayland surface is created under wayland
//! https://bugs.kde.org/show_bug.cgi?id=392890
if (KWindowSystem::isPlatformWayland() && !m_shellSurface) {
return;
}
if (!m_background) {
m_background = new Plasma::FrameSvg(this);
}

@ -30,12 +30,6 @@ class FrameSvg;
class Types;
}
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
class Corona;
class View;

@ -22,8 +22,6 @@
// KDE
#include <KLocalizedContext>
#include <KDeclarative/KDeclarative>
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
#include <KWindowEffects>
#include <KWindowSystem>
@ -151,10 +149,6 @@ void SecondaryConfigView::syncGeometry()
setPosition(position);
if (m_shellSurface) {
m_shellSurface->setPosition(position);
}
setMaximumSize(size);
setMinimumSize(size);
resize(size);
@ -168,11 +162,6 @@ void SecondaryConfigView::syncGeometry()
void SecondaryConfigView::showEvent(QShowEvent *ev)
{
if (m_shellSurface) {
//! under wayland it needs to be set again after its hiding
m_shellSurface->setPosition(m_geometryWhenVisible.topLeft());
}
SubConfigView::showEvent(ev);
if (!m_latteView) {
@ -214,7 +203,7 @@ void SecondaryConfigView::focusOutEvent(QFocusEvent *ev)
void SecondaryConfigView::hideConfigWindow()
{
if (m_shellSurface) {
if (KWindowSystem::isPlatformWayland()) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {
@ -224,18 +213,6 @@ void SecondaryConfigView::hideConfigWindow()
void SecondaryConfigView::updateEffects()
{
//! Don't apply any effect before the wayland surface is created under wayland
//! https://bugs.kde.org/show_bug.cgi?id=392890
if (KWindowSystem::isPlatformWayland() && !m_shellSurface) {
return;
}
//! Don't apply any effect before the wayland surface is created under wayland
//! https://bugs.kde.org/show_bug.cgi?id=392890
if (KWindowSystem::isPlatformWayland() && !m_shellSurface) {
return;
}
if (!m_background) {
m_background = new Plasma::FrameSvg(this);
}

@ -29,12 +29,6 @@ class FrameSvg;
class Types;
}
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
class Corona;
class View;

@ -19,8 +19,6 @@
// KDE
#include <KLocalizedContext>
#include <KDeclarative/KDeclarative>
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
#include <KWindowSystem>
namespace Latte {
@ -181,7 +179,7 @@ void SubConfigView::initParentView(Latte::View *view)
void SubConfigView::requestActivate()
{
if (KWindowSystem::isPlatformWayland() && m_shellSurface) {
if (KWindowSystem::isPlatformWayland()) {
updateWaylandId();
m_corona->wm()->requestActivate(m_waylandWindowId);
} else {
@ -233,14 +231,9 @@ void SubConfigView::syncSlideEffect()
m_corona->wm()->slideWindow(*this, slideLocation);
}
KWayland::Client::PlasmaShellSurface *SubConfigView::surface()
{
return m_shellSurface;
}
void SubConfigView::setupWaylandIntegration()
{
if (m_shellSurface || !KWindowSystem::isPlatformWayland() || !m_latteView || !m_latteView->containment()) {
/* if (m_shellSurface || !KWindowSystem::isPlatformWayland() || !m_latteView || !m_latteView->containment()) {
// already setup
return;
}
@ -271,14 +264,14 @@ void SubConfigView::setupWaylandIntegration()
updateWaylandId();
syncGeometry();
}
}*/
}
void SubConfigView::showEvent(QShowEvent *ev)
{
QQuickView::showEvent(ev);
if (m_shellSurface) {
if (KWindowSystem::isPlatformWayland()) {
//! readd shadows after hiding because the window shadows are not shown again after first showing
m_corona->dialogShadows()->addWindow(this, m_enabledBorders);
}
@ -286,7 +279,7 @@ void SubConfigView::showEvent(QShowEvent *ev)
bool SubConfigView::event(QEvent *e)
{
if (e->type() == QEvent::PlatformSurface) {
/* if (e->type() == QEvent::PlatformSurface) {
if (auto pe = dynamic_cast<QPlatformSurfaceEvent *>(e)) {
switch (pe->surfaceEventType()) {
case QPlatformSurfaceEvent::SurfaceCreated:
@ -308,7 +301,7 @@ bool SubConfigView::event(QEvent *e)
break;
}
}
}
}*/
return QQuickView::event(e);
}

@ -19,12 +19,6 @@
// Plasma
#include <Plasma/FrameSvg>
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
class Corona;
class View;
@ -55,7 +49,6 @@ public:
virtual void showAfter(int msecs = 0);
Latte::WindowSystem::WindowId trackedWindowId();
KWayland::Client::PlasmaShellSurface *surface();
public slots:
virtual void syncGeometry() = 0;
@ -87,7 +80,6 @@ protected:
Plasma::FrameSvg::EnabledBorders m_enabledBorders{Plasma::FrameSvg::AllBorders};
Latte::Corona *m_corona{nullptr};
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
private slots:
void updateWaylandId();

@ -131,10 +131,6 @@ void WidgetExplorerView::syncGeometry()
setPosition(geometry.topLeft());
if (m_shellSurface) {
m_shellSurface->setPosition(geometry.topLeft());
}
setMaximumSize(geometry.size());
setMinimumSize(geometry.size());
resize(geometry.size());
@ -142,11 +138,6 @@ void WidgetExplorerView::syncGeometry()
void WidgetExplorerView::showEvent(QShowEvent *ev)
{
if (m_shellSurface) {
//! under wayland it needs to be set again after its hiding
m_shellSurface->setPosition(m_geometryWhenVisible.topLeft());
}
SubConfigView::showEvent(ev);
if (!m_latteView) {
@ -176,12 +167,6 @@ void WidgetExplorerView::focusOutEvent(QFocusEvent *ev)
void WidgetExplorerView::updateEffects()
{
//! Don't apply any effect before the wayland surface is created under wayland
//! https://bugs.kde.org/show_bug.cgi?id=392890
if (KWindowSystem::isPlatformWayland() && !m_shellSurface) {
return;
}
if (!m_background) {
m_background = new Plasma::FrameSvg(this);
}

@ -27,12 +27,6 @@ class FrameSvg;
class Types;
}
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
class Corona;
class View;

@ -47,8 +47,6 @@
// KDe
#include <KActionCollection>
#include <KActivities/Consumer>
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
#include <KWindowSystem>
// Plasma
@ -434,7 +432,7 @@ void View::availableScreenRectChangedFromSlot(View *origin)
void View::setupWaylandIntegration()
{
if (m_shellSurface)
/* if (m_shellSurface)
return;
if (Latte::Corona *c = qobject_cast<Latte::Corona *>(corona())) {
@ -457,13 +455,13 @@ void View::setupWaylandIntegration()
if (m_positioner) {
m_positioner->updateWaylandId();
}
}
}*/
}
KWayland::Client::PlasmaShellSurface *View::surface()
/*KWayland::Client::PlasmaShellSurface *View::surface()
{
return m_shellSurface;
}
}*/
//! the main function which decides if this dock is at the
//! correct screen
@ -1527,31 +1525,8 @@ bool View::event(QEvent *e)
break;
case QEvent::PlatformSurface:
if (auto pe = dynamic_cast<QPlatformSurfaceEvent *>(e)) {
switch (pe->surfaceEventType()) {
case QPlatformSurfaceEvent::SurfaceCreated:
setupWaylandIntegration();
if (m_shellSurface) {
//! immediateSyncGeometry helps avoiding binding loops from containment qml side
m_positioner->immediateSyncGeometry();
m_effects->updateShadows();
}
break;
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
if (m_shellSurface) {
delete m_shellSurface;
m_shellSurface = nullptr;
qDebug() << "WAYLAND dock window surface was deleted...";
m_effects->clearShadows();
}
break;
}
}
case QEvent::Expose:
return QQuickWindow::event(e);
break;
case QEvent::Show:

@ -48,12 +48,6 @@ class AppletQuickItem;
}
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
class Corona;
class Interfaces;
@ -251,8 +245,6 @@ public:
Layout::GenericLayout *layout() const;
void setLayout(Layout::GenericLayout *layout);
KWayland::Client::PlasmaShellSurface *surface();
//! release grab and restore mouse state
void unblockMouse(int x, int y);
@ -458,8 +450,6 @@ private:
QList<QWindow *> m_transientWindows;
QPointer<Latte::Corona> m_corona;
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
};
}

@ -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
@ -64,7 +64,7 @@ public:
~GhostWindow() {
m_waylandInterface->unregisterIgnoredWindow(m_winId);
delete m_shellSurface;
// delete m_shellSurface;
}
void setGeometry(const QRect &rect) {
@ -78,11 +78,11 @@ public:
setMaximumSize(rect.size());
resize(rect.size());
m_shellSurface->setPosition(rect.topLeft());
// m_shellSurface->setPosition(rect.topLeft());
}
void setupWaylandIntegration() {
using namespace KWayland::Client;
/* using namespace KWayland::Client;
if (m_shellSurface)
return;
@ -98,10 +98,10 @@ public:
m_shellSurface->setSkipTaskbar(true);
m_shellSurface->setPanelTakesFocus(false);
m_shellSurface->setRole(PlasmaShellSurface::Role::Panel);
m_shellSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible);
m_shellSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible);*/
}
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
// KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
WindowSystem::WaylandInterface *m_waylandInterface{nullptr};
//! geometry() function under wayland does not return nice results
@ -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::initVirtualDesktopManagement(KWayland::Client::PlasmaVirt
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)
@ -206,11 +206,6 @@ void WaylandInterface::setCurrentDesktop(QString desktop)
}
#endif
KWayland::Client::PlasmaShell *WaylandInterface::waylandCoronaInterface() const
{
return m_corona->waylandCoronaInterface();
}
//! Register Latte Ignored Windows in order to NOT be tracked
void WaylandInterface::registerIgnoredWindow(WindowId wid)
{
@ -237,17 +232,17 @@ void WaylandInterface::unregisterIgnoredWindow(WindowId wid)
void WaylandInterface::setViewExtraFlags(QObject *view, bool isPanelWindow, Latte::Types::Visibility mode)
{
KWayland::Client::PlasmaShellSurface *surface = qobject_cast<KWayland::Client::PlasmaShellSurface *>(view);
/* KWayland::Client::PlasmaShellSurface *surface = qobject_cast<KWayland::Client::PlasmaShellSurface *>(view);
Latte::View *latteView = qobject_cast<Latte::View *>(view);
Latte::ViewPart::SubConfigView *configView = qobject_cast<Latte::ViewPart::SubConfigView *>(view);
WindowId winId;
if (latteView) {
surface = latteView->surface();
//surface = latteView->surface();
winId = latteView->positioner()->trackedWindowId();
} else if (configView) {
surface = configView->surface();
//surface = configView->surface();
winId = configView->trackedWindowId();
}
@ -294,12 +289,12 @@ void WaylandInterface::setViewExtraFlags(QObject *view, bool isPanelWindow, Latt
QTimer::singleShot(50, [this, surface]() {
surface->setRole(PlasmaShellSurface::Role::ToolTip);
});
}
}*/
}
void WaylandInterface::setViewStruts(QWindow &view, const QRect &rect, Plasma::Types::Location location)
{
if (!m_ghostWindows.contains(view.winId())) {
/* if (!m_ghostWindows.contains(view.winId())) {
m_ghostWindows[view.winId()] = new Private::GhostWindow(this);
}
@ -318,13 +313,13 @@ void WaylandInterface::setViewStruts(QWindow &view, const QRect &rect, Plasma::T
default:
break;
}
}*/
}
void WaylandInterface::switchToNextVirtualDesktop()
{
#if KF5_VERSION_MINOR >= 52
if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
/* if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
return;
}
@ -343,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;
}
@ -369,7 +364,7 @@ void WaylandInterface::switchToPreviousVirtualDesktop()
if (desktopObj) {
desktopObj->requestActivate();
}
}*/
#endif
}
@ -481,7 +476,7 @@ void WaylandInterface::setActiveEdge(QWindow *view, bool active)
return;
}
if (window->parentView()->surface() && window->parentView()->visibility()
/*if (window->parentView()->surface() && window->parentView()->visibility()
&& (window->parentView()->visibility()->mode() == Types::DodgeActive
|| window->parentView()->visibility()->mode() == Types::DodgeMaximized
|| window->parentView()->visibility()->mode() == Types::DodgeAllWindows
@ -493,7 +488,7 @@ void WaylandInterface::setActiveEdge(QWindow *view, bool active)
window->hideWithMask();
window->surface()->requestShowAutoHidingPanel();
}
}
}*/
}
void WaylandInterface::setFrameExtents(QWindow *view, const QMargins &extents)
@ -603,6 +598,10 @@ AppData WaylandInterface::appDataFor(WindowId wid)
KWayland::Client::PlasmaWindow *WaylandInterface::windowFor(WindowId wid)
{
if (!m_windowManagement) {
return nullptr;
}
auto it = std::find_if(m_windowManagement->windows().constBegin(), m_windowManagement->windows().constEnd(), [&wid](PlasmaWindow * w) noexcept {
return w->isValid() && w->internalId() == wid;
});
@ -628,6 +627,10 @@ QIcon WaylandInterface::iconFor(WindowId wid)
WindowId WaylandInterface::winIdFor(QString appId, QString title)
{
if (!m_windowManagement) {
return -1;
}
auto it = std::find_if(m_windowManagement->windows().constBegin(), m_windowManagement->windows().constEnd(), [&appId, &title](PlasmaWindow * w) noexcept {
return w->isValid() && w->appId() == appId && w->title().startsWith(title);
});
@ -641,6 +644,10 @@ WindowId WaylandInterface::winIdFor(QString appId, QString title)
WindowId WaylandInterface::winIdFor(QString appId, QRect geometry)
{
if (!m_windowManagement) {
return -1;
}
auto it = std::find_if(m_windowManagement->windows().constBegin(), m_windowManagement->windows().constEnd(), [&appId, &geometry](PlasmaWindow * w) noexcept {
return w->isValid() && w->appId() == appId && w->geometry() == geometry;
});

@ -17,13 +17,9 @@
#include <QObject>
// KDE
#include <KWayland/Client/registry.h>
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/plasmawindowmanagement.h>
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
#include <KWindowInfo>
#include <KWindowEffects>
#include <KWayland/Client/plasmawindowmanagement.h>
namespace Latte {
@ -94,7 +90,7 @@ public:
#if KF5_VERSION_MINOR >= 52
//! VirtualDesktopsSupport
void initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement);
//void initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement);
#endif
private slots:
@ -113,7 +109,6 @@ private:
void untrackWindow(KWayland::Client::PlasmaWindow *w);
KWayland::Client::PlasmaWindow *windowFor(WindowId wid);
KWayland::Client::PlasmaShell *waylandCoronaInterface() const;
#if KF5_VERSION_MINOR >= 52
//! VirtualDesktopsSupport
@ -129,7 +124,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…
Cancel
Save