Make spring cleaning to match our KF5_MIN_VERSION

Since we already require 5.71.0 as min version of KF , it is meaning less to keep old checks for lower versions in code, this will make code more and more cleaner

Since all plasma using cpp17 and we recently switch to cpp14 think that it may be better to keep it more up-to-date and match with plasma
work/m_edgeslide
Ömer Fadıl Usta 3 years ago
parent aa57d21515
commit 3c5b474a97

@ -1,7 +1,8 @@
project(lattedock) project(lattedock)
cmake_minimum_required(VERSION 3.16 FATAL_ERROR) cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(VERSION 0.10.75) set(VERSION 0.10.75)
set(AUTHOR "Michail Vourlakos, Smith Ar") set(AUTHOR "Michail Vourlakos, Smith Ar")
set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org") set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org")
@ -51,9 +52,6 @@ string(REGEX REPLACE "\\." "" KF5_VERSION_MINOR ${KF5_VERSION_MINOR})
message(STATUS "KF5 VERSION : ${KF5_VERSION}") message(STATUS "KF5 VERSION : ${KF5_VERSION}")
message(STATUS "KF5 VERSION MINOR : ${KF5_VERSION_MINOR}") message(STATUS "KF5 VERSION MINOR : ${KF5_VERSION_MINOR}")
if(${KF5_VERSION_MINOR} LESS "62")
find_package(KF5 REQUIRED COMPONENTS SysGuard)
endif()
include(ECMQMLModules) include(ECMQMLModules)
ecm_find_qmlmodule(QtQuick 2.7) ecm_find_qmlmodule(QtQuick 2.7)

@ -53,57 +53,30 @@ add_executable(latte-dock ${lattedock-app_SRCS})
include(FakeTarget.cmake) include(FakeTarget.cmake)
if(${KF5_VERSION_MINOR} LESS "62") target_link_libraries(latte-dock
target_link_libraries(latte-dock Qt5::DBus
Qt5::DBus Qt5::Quick
Qt5::Quick Qt5::Qml
Qt5::Qml KF5::Activities
KF5::Activities KF5::Archive
KF5::Archive KF5::CoreAddons
KF5::CoreAddons KF5::Crash
KF5::Crash KF5::DBusAddons
KF5::DBusAddons KF5::Declarative
KF5::Declarative KF5::GuiAddons
KF5::GuiAddons KF5::GlobalAccel
KF5::GlobalAccel KF5::I18n
KF5::I18n KF5::IconThemes
KF5::IconThemes KF5::KIOWidgets
KF5::KIOWidgets KF5::Notifications
KF5::Notifications KF5::NewStuff
KF5::NewStuff KF5::QuickAddons
KF5::QuickAddons KF5::Plasma
KF5::Plasma KF5::PlasmaQuick
KF5::PlasmaQuick KF5::WaylandClient
KF5::ProcessCore KF5::XmlGui
KF5::WaylandClient )
KF5::XmlGui
)
else()
target_link_libraries(latte-dock
Qt5::DBus
Qt5::Quick
Qt5::Qml
KF5::Activities
KF5::Archive
KF5::CoreAddons
KF5::Crash
KF5::DBusAddons
KF5::Declarative
KF5::GuiAddons
KF5::GlobalAccel
KF5::I18n
KF5::IconThemes
KF5::KIOWidgets
KF5::Notifications
KF5::NewStuff
KF5::QuickAddons
KF5::Plasma
KF5::PlasmaQuick
KF5::WaylandClient
KF5::XmlGui
)
endif()
if(HAVE_X11) if(HAVE_X11)
target_link_libraries(latte-dock target_link_libraries(latte-dock
@ -122,13 +95,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.latte-dock.desktop DESTINATION
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.latte-dock.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.latte-dock.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES dbus/org.kde.LatteDock.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}) install(FILES dbus/org.kde.LatteDock.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
install(FILES lattedock.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR}) install(FILES lattedock.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
install(FILES latte-layouts.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
install(FILES latte-indicators.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
if(${KF5_VERSION_MINOR} LESS "57")
install(FILES latte-layouts.knsrc DESTINATION ${CONFIG_INSTALL_DIR})
install(FILES latte-indicators.knsrc DESTINATION ${CONFIG_INSTALL_DIR})
else()
install(FILES latte-layouts.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
install(FILES latte-indicators.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
endif()
add_subdirectory(packageplugins) add_subdirectory(packageplugins)

@ -80,12 +80,8 @@ void InfoView::init()
KDeclarative::KDeclarative kdeclarative; KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine()); kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setTranslationDomain(QStringLiteral("latte-dock")); kdeclarative.setTranslationDomain(QStringLiteral("latte-dock"));
#if KF5_VERSION_MINOR >= 45
kdeclarative.setupContext(); kdeclarative.setupContext();
kdeclarative.setupEngine(engine()); kdeclarative.setupEngine(engine());
#else
kdeclarative.setupBindings();
#endif
auto source = QUrl::fromLocalFile(m_corona->kPackage().filePath("infoviewui")); auto source = QUrl::fromLocalFile(m_corona->kPackage().filePath("infoviewui"));
setSource(source); setSource(source);

@ -328,7 +328,7 @@ void Corona::setupWaylandIntegration()
} }
}); });
#if KF5_VERSION_MINOR >= 52
QObject::connect(registry, &KWayland::Client::Registry::plasmaVirtualDesktopManagementAnnounced, QObject::connect(registry, &KWayland::Client::Registry::plasmaVirtualDesktopManagementAnnounced,
[this, registry] (quint32 name, quint32 version) { [this, registry] (quint32 name, quint32 version) {
KWayland::Client::PlasmaVirtualDesktopManagement *vdm = registry->createPlasmaVirtualDesktopManagement(name, version, this); KWayland::Client::PlasmaVirtualDesktopManagement *vdm = registry->createPlasmaVirtualDesktopManagement(name, version, this);
@ -339,7 +339,7 @@ void Corona::setupWaylandIntegration()
wI->initVirtualDesktopManagement(vdm); wI->initVirtualDesktopManagement(vdm);
} }
}); });
#endif
registry->setup(); registry->setup();
connection->roundtrip(); connection->roundtrip();

@ -31,12 +31,8 @@
// KDE // KDE
#include <KMessageWidget> #include <KMessageWidget>
#include <KSharedConfig> #include <KSharedConfig>
#if KF5_VERSION_MINOR >= 71
#include <KIO/OpenUrlJob> #include <KIO/OpenUrlJob>
#else
#include <KRun>
#endif
namespace Latte { namespace Latte {
namespace Settings { namespace Settings {
@ -604,12 +600,8 @@ void Views::showDefaultPersistentErrorWarningInlineMessage(const QString &messag
QString file = openlayoutaction->data().toString(); QString file = openlayoutaction->data().toString();
if (!file.isEmpty()) { if (!file.isEmpty()) {
#if KF5_VERSION_MINOR >= 71
auto job = new KIO::OpenUrlJob(QUrl::fromLocalFile(file), QStringLiteral("text/plain"), this); auto job = new KIO::OpenUrlJob(QUrl::fromLocalFile(file), QStringLiteral("text/plain"), this);
job->start(); job->start();
#else
KRun::runUrl(QUrl::fromLocalFile(file), QStringLiteral("text/plain"), m_view);
#endif
showDefaultInlineMessageValidator(); showDefaultInlineMessageValidator();
} }
}); });

@ -581,8 +581,6 @@ void Effects::updateEffects()
//! adjust mask coordinates based on local coordinates //! adjust mask coordinates based on local coordinates
int fX = m_rect.x(); int fY = m_rect.y(); int fX = m_rect.x(); int fY = m_rect.y();
#if KF5_VERSION_MINOR >= 65
//! Latte is now using GtkFrameExtents so Effects geometries must be adjusted //! Latte is now using GtkFrameExtents so Effects geometries must be adjusted
//! windows that use GtkFrameExtents and apply Effects on them they take GtkFrameExtents //! windows that use GtkFrameExtents and apply Effects on them they take GtkFrameExtents
//! as granted //! as granted
@ -593,7 +591,6 @@ void Effects::updateEffects()
fX = qMax(0, fX - m_view->headThicknessGap()); fX = qMax(0, fX - m_view->headThicknessGap());
} }
} }
#endif
//! There are cases that mask is NULL even though it should not //! There are cases that mask is NULL even though it should not
//! Example: SidebarOnDemand from v0.10 that BEHAVEASPLASMAPANEL in EditMode //! Example: SidebarOnDemand from v0.10 that BEHAVEASPLASMAPANEL in EditMode

@ -117,12 +117,9 @@ void SubConfigView::init()
KDeclarative::KDeclarative kdeclarative; KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine()); kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setTranslationDomain(QStringLiteral("latte-dock")); kdeclarative.setTranslationDomain(QStringLiteral("latte-dock"));
#if KF5_VERSION_MINOR >= 45
kdeclarative.setupContext(); kdeclarative.setupContext();
kdeclarative.setupEngine(engine()); kdeclarative.setupEngine(engine());
#else
kdeclarative.setupBindings();
#endif
} }
Qt::WindowFlags SubConfigView::wFlags() const Qt::WindowFlags SubConfigView::wFlags() const

@ -15,13 +15,7 @@
#include <KSharedConfig> #include <KSharedConfig>
#include <KStartupInfo> #include <KStartupInfo>
#include <KWindowSystem> #include <KWindowSystem>
#include <KProcessList>
#if KF5_VERSION_MINOR >= 62
#include <KProcessList>
#else
#include <processcore/processes.h>
#include <processcore/process.h>
#endif
#include <QDir> #include <QDir>
#include <QGuiApplication> #include <QGuiApplication>
@ -492,30 +486,21 @@ KService::List servicesFromPid(quint32 pid, KSharedConfig::Ptr rulesConfig)
return KService::List(); return KService::List();
} }
#if KF5_VERSION_MINOR >= 62
auto proc = KProcessList::processInfo(pid);
if (!proc.isValid()) {
return KService::List();
}
const QString cmdLine = proc.command(); auto proc = KProcessList::processInfo(pid);
#else if (!proc.isValid()) {
KSysGuard::Processes procs; return KService::List();
procs.updateOrAddProcess(pid); }
const QString cmdLine = proc.command();
KSysGuard::Process *proc = procs.getProcess(pid);
const QString &cmdLine = proc ? proc->command().simplified() : QString(); // proc->command has a trailing space???
#endif
if (cmdLine.isEmpty()) { if (cmdLine.isEmpty()) {
return KService::List(); return KService::List();
} }
#if KF5_VERSION_MINOR >= 62 return servicesFromCmdLine(cmdLine, proc.name(), rulesConfig);
return servicesFromCmdLine(cmdLine, proc.name(), rulesConfig);
#else
return servicesFromCmdLine(cmdLine, proc->name(), rulesConfig);
#endif
} }
KService::List servicesFromCmdLine(const QString &_cmdLine, const QString &processName, KService::List servicesFromCmdLine(const QString &_cmdLine, const QString &processName,

@ -28,9 +28,8 @@
#include <KWindowInfo> #include <KWindowInfo>
#include <KWayland/Client/surface.h> #include <KWayland/Client/surface.h>
#if KF5_VERSION_MINOR >= 52
#include <KWayland/Client/plasmavirtualdesktop.h> #include <KWayland/Client/plasmavirtualdesktop.h>
#endif
// X11 // X11
#include <NETWM> #include <NETWM>
@ -150,7 +149,6 @@ void WaylandInterface::initWindowManagement(KWayland::Client::PlasmaWindowManage
}, Qt::QueuedConnection); }, Qt::QueuedConnection);
} }
#if KF5_VERSION_MINOR >= 52
void WaylandInterface::initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement) void WaylandInterface::initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement)
{ {
if (m_virtualDesktopManagement == virtualDesktopManagement) { if (m_virtualDesktopManagement == virtualDesktopManagement) {
@ -204,7 +202,6 @@ void WaylandInterface::setCurrentDesktop(QString desktop)
m_currentDesktop = desktop; m_currentDesktop = desktop;
emit currentDesktopChanged(); emit currentDesktopChanged();
} }
#endif
KWayland::Client::PlasmaShell *WaylandInterface::waylandCoronaInterface() const KWayland::Client::PlasmaShell *WaylandInterface::waylandCoronaInterface() const
{ {
@ -256,9 +253,7 @@ void WaylandInterface::setViewExtraFlags(QObject *view, bool isPanelWindow, Latt
} }
surface->setSkipTaskbar(true); surface->setSkipTaskbar(true);
#if KF5_VERSION_MINOR >= 47
surface->setSkipSwitcher(true); surface->setSkipSwitcher(true);
#endif
bool atBottom{!isPanelWindow && (mode == Latte::Types::WindowsCanCover || mode == Latte::Types::WindowsAlwaysCover)}; bool atBottom{!isPanelWindow && (mode == Latte::Types::WindowsCanCover || mode == Latte::Types::WindowsAlwaysCover)};
@ -323,7 +318,6 @@ void WaylandInterface::setViewStruts(QWindow &view, const QRect &rect, Plasma::T
void WaylandInterface::switchToNextVirtualDesktop() void WaylandInterface::switchToNextVirtualDesktop()
{ {
#if KF5_VERSION_MINOR >= 52
if (!m_virtualDesktopManagement || m_desktops.count() <= 1) { if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
return; return;
} }
@ -344,12 +338,10 @@ void WaylandInterface::switchToNextVirtualDesktop()
if (desktopObj) { if (desktopObj) {
desktopObj->requestActivate(); desktopObj->requestActivate();
} }
#endif
} }
void WaylandInterface::switchToPreviousVirtualDesktop() void WaylandInterface::switchToPreviousVirtualDesktop()
{ {
#if KF5_VERSION_MINOR >= 52
if (!m_virtualDesktopManagement || m_desktops.count() <= 1) { if (!m_virtualDesktopManagement || m_desktops.count() <= 1) {
return; return;
} }
@ -370,7 +362,6 @@ void WaylandInterface::switchToPreviousVirtualDesktop()
if (desktopObj) { if (desktopObj) {
desktopObj->requestActivate(); desktopObj->requestActivate();
} }
#endif
} }
void WaylandInterface::setWindowOnActivities(const WindowId &wid, const QStringList &nextactivities) void WaylandInterface::setWindowOnActivities(const WindowId &wid, const QStringList &nextactivities)
@ -547,10 +538,7 @@ WindowInfoWrap WaylandInterface::requestInfo(WindowId wid)
winfoWrap.setIsKeepAbove(w->isKeepAbove()); winfoWrap.setIsKeepAbove(w->isKeepAbove());
winfoWrap.setIsKeepBelow(w->isKeepBelow()); winfoWrap.setIsKeepBelow(w->isKeepBelow());
winfoWrap.setGeometry(w->geometry()); winfoWrap.setGeometry(w->geometry());
#if KF5_VERSION_MINOR >= 47
winfoWrap.setHasSkipSwitcher(w->skipSwitcher()); winfoWrap.setHasSkipSwitcher(w->skipSwitcher());
#endif
winfoWrap.setHasSkipTaskbar(w->skipTaskbar()); winfoWrap.setHasSkipTaskbar(w->skipTaskbar());
//! BEGIN:Window Abilities //! BEGIN:Window Abilities
@ -565,9 +553,7 @@ WindowInfoWrap WaylandInterface::requestInfo(WindowId wid)
//! END:Window Abilities //! END:Window Abilities
winfoWrap.setDisplay(w->title()); winfoWrap.setDisplay(w->title());
#if KF5_VERSION_MINOR >= 52
winfoWrap.setDesktops(w->plasmaVirtualDesktops()); winfoWrap.setDesktops(w->plasmaVirtualDesktops());
#endif
#if KF5_VERSION_MINOR >= 81 #if KF5_VERSION_MINOR >= 81
winfoWrap.setActivities(w->plasmaActivities()); winfoWrap.setActivities(w->plasmaActivities());
@ -716,7 +702,6 @@ void WaylandInterface::requestMoveWindow(WindowId wid, QPoint from)
void WaylandInterface::requestToggleIsOnAllDesktops(WindowId wid) void WaylandInterface::requestToggleIsOnAllDesktops(WindowId wid)
{ {
#if KF5_VERSION_MINOR >= 52
auto w = windowFor(wid); auto w = windowFor(wid);
if (w && isValidWindow(w) && m_desktops.count() > 1) { if (w && isValidWindow(w) && m_desktops.count() > 1) {
@ -730,7 +715,6 @@ void WaylandInterface::requestToggleIsOnAllDesktops(WindowId wid)
} }
} }
} }
#endif
} }
void WaylandInterface::requestToggleKeepAbove(WindowId wid) void WaylandInterface::requestToggleKeepAbove(WindowId wid)
@ -782,11 +766,9 @@ void WaylandInterface::requestToggleMinimized(WindowId wid)
WindowInfoWrap wInfo = requestInfo(wid); WindowInfoWrap wInfo = requestInfo(wid);
if (w && isValidWindow(w) && inCurrentDesktopActivity(wInfo)) { if (w && isValidWindow(w) && inCurrentDesktopActivity(wInfo)) {
#if KF5_VERSION_MINOR >= 52
if (!m_currentDesktop.isEmpty()) { if (!m_currentDesktop.isEmpty()) {
w->requestEnterVirtualDesktop(m_currentDesktop); w->requestEnterVirtualDesktop(m_currentDesktop);
} }
#endif
w->requestToggleMinimized(); w->requestToggleMinimized();
} }
} }
@ -797,11 +779,9 @@ void WaylandInterface::requestToggleMaximized(WindowId wid)
WindowInfoWrap wInfo = requestInfo(wid); WindowInfoWrap wInfo = requestInfo(wid);
if (w && isValidWindow(w) && windowCanBeMaximized(wid) && inCurrentDesktopActivity(wInfo)) { if (w && isValidWindow(w) && windowCanBeMaximized(wid) && inCurrentDesktopActivity(wInfo)) {
#if KF5_VERSION_MINOR >= 52
if (!m_currentDesktop.isEmpty()) { if (!m_currentDesktop.isEmpty()) {
w->requestEnterVirtualDesktop(m_currentDesktop); w->requestEnterVirtualDesktop(m_currentDesktop);
} }
#endif
w->requestToggleMaximized(); w->requestToggleMaximized();
} }
} }
@ -865,11 +845,8 @@ bool WaylandInterface::isAcceptableWindow(const KWayland::Client::PlasmaWindow *
//! Window Checks //! Window Checks
bool hasSkipTaskbar = w->skipTaskbar(); bool hasSkipTaskbar = w->skipTaskbar();
bool isSkipped = hasSkipTaskbar; bool isSkipped = hasSkipTaskbar;
#if KF5_VERSION_MINOR >= 47
bool hasSkipSwitcher = w->skipSwitcher(); bool hasSkipSwitcher = w->skipSwitcher();
isSkipped = hasSkipTaskbar && hasSkipSwitcher; isSkipped = hasSkipTaskbar && hasSkipSwitcher;
#endif
if (isSkipped if (isSkipped
&& ((w->appId() == QLatin1String("yakuake") && ((w->appId() == QLatin1String("yakuake")
@ -929,13 +906,9 @@ void WaylandInterface::trackWindow(KWayland::Client::PlasmaWindow *w)
connect(w, &PlasmaWindow::skipTaskbarChanged, this, &WaylandInterface::updateWindow); connect(w, &PlasmaWindow::skipTaskbarChanged, this, &WaylandInterface::updateWindow);
connect(w, &PlasmaWindow::onAllDesktopsChanged, this, &WaylandInterface::updateWindow); connect(w, &PlasmaWindow::onAllDesktopsChanged, this, &WaylandInterface::updateWindow);
connect(w, &PlasmaWindow::parentWindowChanged, this, &WaylandInterface::updateWindow); connect(w, &PlasmaWindow::parentWindowChanged, this, &WaylandInterface::updateWindow);
#if KF5_VERSION_MINOR >= 52
connect(w, &PlasmaWindow::plasmaVirtualDesktopEntered, this, &WaylandInterface::updateWindow); connect(w, &PlasmaWindow::plasmaVirtualDesktopEntered, this, &WaylandInterface::updateWindow);
connect(w, &PlasmaWindow::plasmaVirtualDesktopLeft, this, &WaylandInterface::updateWindow); connect(w, &PlasmaWindow::plasmaVirtualDesktopLeft, this, &WaylandInterface::updateWindow);
#else
connect(w, &PlasmaWindow::virtualDesktopChanged, this, &WaylandInterface::updateWindow);
#endif
#if KF5_VERSION_MINOR >= 81 #if KF5_VERSION_MINOR >= 81
connect(w, &PlasmaWindow::plasmaActivityEntered, this, &WaylandInterface::updateWindow); connect(w, &PlasmaWindow::plasmaActivityEntered, this, &WaylandInterface::updateWindow);
@ -962,13 +935,9 @@ void WaylandInterface::untrackWindow(KWayland::Client::PlasmaWindow *w)
disconnect(w, &PlasmaWindow::skipTaskbarChanged, this, &WaylandInterface::updateWindow); disconnect(w, &PlasmaWindow::skipTaskbarChanged, this, &WaylandInterface::updateWindow);
disconnect(w, &PlasmaWindow::onAllDesktopsChanged, this, &WaylandInterface::updateWindow); disconnect(w, &PlasmaWindow::onAllDesktopsChanged, this, &WaylandInterface::updateWindow);
disconnect(w, &PlasmaWindow::parentWindowChanged, this, &WaylandInterface::updateWindow); disconnect(w, &PlasmaWindow::parentWindowChanged, this, &WaylandInterface::updateWindow);
#if KF5_VERSION_MINOR >= 52
disconnect(w, &PlasmaWindow::plasmaVirtualDesktopEntered, this, &WaylandInterface::updateWindow); disconnect(w, &PlasmaWindow::plasmaVirtualDesktopEntered, this, &WaylandInterface::updateWindow);
disconnect(w, &PlasmaWindow::plasmaVirtualDesktopLeft, this, &WaylandInterface::updateWindow); disconnect(w, &PlasmaWindow::plasmaVirtualDesktopLeft, this, &WaylandInterface::updateWindow);
#else
disconnect(w, &PlasmaWindow::virtualDesktopChanged, this, &WaylandInterface::updateWindow);
#endif
#if KF5_VERSION_MINOR >= 81 #if KF5_VERSION_MINOR >= 81
disconnect(w, &PlasmaWindow::plasmaActivityEntered, this, &WaylandInterface::updateWindow); disconnect(w, &PlasmaWindow::plasmaActivityEntered, this, &WaylandInterface::updateWindow);

@ -92,10 +92,9 @@ public:
void initWindowManagement(KWayland::Client::PlasmaWindowManagement *windowManagement); void initWindowManagement(KWayland::Client::PlasmaWindowManagement *windowManagement);
#if KF5_VERSION_MINOR >= 52
//! VirtualDesktopsSupport //! VirtualDesktopsSupport
void initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement); void initVirtualDesktopManagement(KWayland::Client::PlasmaVirtualDesktopManagement *virtualDesktopManagement);
#endif
private slots: private slots:
void updateWindow(); void updateWindow();
@ -115,11 +114,10 @@ private:
KWayland::Client::PlasmaWindow *windowFor(WindowId wid); KWayland::Client::PlasmaWindow *windowFor(WindowId wid);
KWayland::Client::PlasmaShell *waylandCoronaInterface() const; KWayland::Client::PlasmaShell *waylandCoronaInterface() const;
#if KF5_VERSION_MINOR >= 52
//! VirtualDesktopsSupport //! VirtualDesktopsSupport
void setCurrentDesktop(QString desktop); void setCurrentDesktop(QString desktop);
void addDesktop(const QString &id, quint32 position); void addDesktop(const QString &id, quint32 position);
#endif
private: private:
friend class Private::GhostWindow; friend class Private::GhostWindow;
@ -127,11 +125,10 @@ private:
KWayland::Client::PlasmaWindowManagement *m_windowManagement{nullptr}; KWayland::Client::PlasmaWindowManagement *m_windowManagement{nullptr};
#if KF5_VERSION_MINOR >= 52
//! VirtualDesktopsSupport //! VirtualDesktopsSupport
KWayland::Client::PlasmaVirtualDesktopManagement *m_virtualDesktopManagement{nullptr}; KWayland::Client::PlasmaVirtualDesktopManagement *m_virtualDesktopManagement{nullptr};
QStringList m_desktops; QStringList m_desktops;
#endif
Latte::Corona *m_corona{nullptr}; Latte::Corona *m_corona{nullptr};
}; };

@ -93,12 +93,7 @@ void XWindowInterface::setViewExtraFlags(QObject *view,bool isPanelWindow, Latte
KWindowSystem::setType(winId, NET::Normal); KWindowSystem::setType(winId, NET::Normal);
} }
#if KF5_VERSION_MINOR >= 45
KWindowSystem::setState(winId, NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); KWindowSystem::setState(winId, NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
#else
KWindowSystem::setState(winId, NET::SkipTaskbar | NET::SkipPager);
#endif
KWindowSystem::setOnAllDesktops(winId, true); KWindowSystem::setOnAllDesktops(winId, true);
//! Layer to be applied //! Layer to be applied
@ -323,7 +318,6 @@ void XWindowInterface::setActiveEdge(QWindow *view, bool active)
xcb_change_property(c, XCB_PROP_MODE_REPLACE, window->winId(), atom->atom, XCB_ATOM_CARDINAL, 32, 1, &value); xcb_change_property(c, XCB_PROP_MODE_REPLACE, window->winId(), atom->atom, XCB_ATOM_CARDINAL, 32, 1, &value);
} }
#if KF5_VERSION_MINOR >= 65
QRect XWindowInterface::visibleGeometry(const WindowId &wid, const QRect &frameGeometry) const QRect XWindowInterface::visibleGeometry(const WindowId &wid, const QRect &frameGeometry) const
{ {
NETWinInfo ni(QX11Info::connection(), wid.toUInt(), QX11Info::appRootWindow(), 0, NET::WM2GTKFrameExtents); NETWinInfo ni(QX11Info::connection(), wid.toUInt(), QX11Info::appRootWindow(), 0, NET::WM2GTKFrameExtents);
@ -337,7 +331,7 @@ QRect XWindowInterface::visibleGeometry(const WindowId &wid, const QRect &frameG
return visibleGeometry; return visibleGeometry;
} }
#endif
void XWindowInterface::setFrameExtents(QWindow *view, const QMargins &margins) void XWindowInterface::setFrameExtents(QWindow *view, const QMargins &margins)
@ -346,7 +340,6 @@ void XWindowInterface::setFrameExtents(QWindow *view, const QMargins &margins)
return; return;
} }
#if KF5_VERSION_MINOR >= 65
NETWinInfo ni(QX11Info::connection(), view->winId(), QX11Info::appRootWindow(), 0, NET::WM2GTKFrameExtents); NETWinInfo ni(QX11Info::connection(), view->winId(), QX11Info::appRootWindow(), 0, NET::WM2GTKFrameExtents);
if (margins.isNull()) { if (margins.isNull()) {
@ -377,7 +370,7 @@ void XWindowInterface::setFrameExtents(QWindow *view, const QMargins &margins)
NETStrut applied = ni2.gtkFrameExtents(); NETStrut applied = ni2.gtkFrameExtents();
QMargins amargins(applied.left, applied.top, applied.right, applied.bottom); QMargins amargins(applied.left, applied.top, applied.right, applied.bottom);
qDebug() << " window gtk frame extents applied :: " << amargins;*/ qDebug() << " window gtk frame extents applied :: " << amargins;*/
#endif
} }
void XWindowInterface::checkShapeExtension() void XWindowInterface::checkShapeExtension()
@ -471,17 +464,11 @@ WindowInfoWrap XWindowInterface::requestInfo(WindowId wid)
winfoWrap.setIsShaded(winfo.hasState(NET::Shaded)); winfoWrap.setIsShaded(winfo.hasState(NET::Shaded));
winfoWrap.setIsOnAllDesktops(winfo.onAllDesktops()); winfoWrap.setIsOnAllDesktops(winfo.onAllDesktops());
winfoWrap.setIsOnAllActivities(winfo.activities().empty()); winfoWrap.setIsOnAllActivities(winfo.activities().empty());
#if KF5_VERSION_MINOR >= 65
winfoWrap.setGeometry(visibleGeometry(wid, winfo.frameGeometry())); winfoWrap.setGeometry(visibleGeometry(wid, winfo.frameGeometry()));
#else
winfoWrap.setGeometry(winfo.frameGeometry());
#endif
winfoWrap.setIsKeepAbove(winfo.hasState(NET::KeepAbove)); winfoWrap.setIsKeepAbove(winfo.hasState(NET::KeepAbove));
winfoWrap.setIsKeepBelow(winfo.hasState(NET::KeepBelow)); winfoWrap.setIsKeepBelow(winfo.hasState(NET::KeepBelow));
winfoWrap.setHasSkipPager(winfo.hasState(NET::SkipPager)); winfoWrap.setHasSkipPager(winfo.hasState(NET::SkipPager));
#if KF5_VERSION_MINOR >= 45
winfoWrap.setHasSkipSwitcher(winfo.hasState(NET::SkipSwitcher)); winfoWrap.setHasSkipSwitcher(winfo.hasState(NET::SkipSwitcher));
#endif
winfoWrap.setHasSkipTaskbar(winfo.hasState(NET::SkipTaskbar)); winfoWrap.setHasSkipTaskbar(winfo.hasState(NET::SkipTaskbar));
//! BEGIN:Window Abilities //! BEGIN:Window Abilities

@ -75,9 +75,7 @@ private:
bool isAcceptableWindow(WindowId wid); bool isAcceptableWindow(WindowId wid);
bool isValidWindow(WindowId wid); bool isValidWindow(WindowId wid);
#if KF5_VERSION_MINOR >= 65
QRect visibleGeometry(const WindowId &wid, const QRect &frameGeometry) const; QRect visibleGeometry(const WindowId &wid, const QRect &frameGeometry) const;
#endif
void windowAddedProxy(WId wid); void windowAddedProxy(WId wid);
void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2); void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2);

Loading…
Cancel
Save