mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-21 10:50:30 +03:00
remove deprecated code from AbstractWindowInterfa
This commit is contained in:
parent
48d3728005
commit
ebaf81ddd8
@ -87,7 +87,6 @@ public:
|
||||
virtual WindowInfoWrap requestInfoActive() const = 0;
|
||||
virtual bool isOnCurrentDesktop(WindowId wid) const = 0;
|
||||
virtual bool isOnCurrentActivity(WindowId wid) const = 0;
|
||||
virtual const std::list<WindowId> &windows() const = 0;
|
||||
|
||||
virtual void setKeepAbove(const QDialog &dialog, bool above = true) const = 0;
|
||||
virtual void skipTaskBar(const QDialog &dialog) const = 0;
|
||||
@ -115,7 +114,6 @@ signals:
|
||||
void currentActivityChanged();
|
||||
|
||||
protected:
|
||||
std::list<WindowId> m_windows;
|
||||
QPointer<KActivities::Consumer> m_activities;
|
||||
|
||||
private:
|
||||
|
@ -188,11 +188,6 @@ WindowId WaylandInterface::activeWindow() const
|
||||
return wid ? wid->internalId() : 0;
|
||||
}
|
||||
|
||||
const std::list<WindowId> &WaylandInterface::windows() const
|
||||
{
|
||||
return m_windows;
|
||||
}
|
||||
|
||||
void WaylandInterface::setKeepAbove(const QDialog &dialog, bool above) const
|
||||
{
|
||||
if (above) {
|
||||
@ -462,7 +457,6 @@ void WaylandInterface::windowCreatedProxy(KWayland::Client::PlasmaWindow *w)
|
||||
|
||||
connect(w, &PlasmaWindow::unmapped, this, [ &, win = w]() noexcept {
|
||||
mapper->removeMappings(win);
|
||||
m_windows.remove(win->internalId());
|
||||
emit windowRemoved(win->internalId());
|
||||
});
|
||||
|
||||
@ -486,8 +480,6 @@ void WaylandInterface::windowCreatedProxy(KWayland::Client::PlasmaWindow *w)
|
||||
}
|
||||
});
|
||||
|
||||
m_windows.push_back(w->internalId());
|
||||
|
||||
emit windowAdded(w->internalId());
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,6 @@ public:
|
||||
WindowInfoWrap requestInfoActive() const override;
|
||||
bool isOnCurrentDesktop(WindowId wid) const override;
|
||||
bool isOnCurrentActivity(WindowId wid) const override;
|
||||
const std::list<WindowId> &windows() const override;
|
||||
|
||||
void setKeepAbove(const QDialog &dialog, bool above = true) const override;
|
||||
void skipTaskBar(const QDialog &dialog) const override;
|
||||
|
@ -45,38 +45,17 @@ XWindowInterface::XWindowInterface(QObject *parent)
|
||||
: AbstractWindowInterface(parent)
|
||||
{
|
||||
m_activities = new KActivities::Consumer(this);
|
||||
connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged
|
||||
, this, &AbstractWindowInterface::activeWindowChanged);
|
||||
connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, this, &AbstractWindowInterface::activeWindowChanged);
|
||||
connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &AbstractWindowInterface::windowAdded);
|
||||
connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &AbstractWindowInterface::windowRemoved);
|
||||
connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged, this, &XWindowInterface::currentDesktopChanged);
|
||||
|
||||
connect(KWindowSystem::self()
|
||||
, static_cast<void (KWindowSystem::*)(WId, NET::Properties, NET::Properties2)>
|
||||
(&KWindowSystem::windowChanged)
|
||||
, this, &XWindowInterface::windowChangedProxy);
|
||||
|
||||
auto addWindow = [&](WindowId wid) {
|
||||
if (std::find(m_windows.cbegin(), m_windows.cend(), wid) == m_windows.cend()) {
|
||||
if (isValidWindow(KWindowInfo(wid.value<WId>(), NET::WMWindowType))) {
|
||||
m_windows.push_back(wid);
|
||||
emit windowAdded(wid);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, addWindow);
|
||||
connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, [this](WindowId wid) noexcept {
|
||||
if (std::find(m_windows.cbegin(), m_windows.cend(), wid) != m_windows.end()) {
|
||||
m_windows.remove(wid);
|
||||
emit windowRemoved(wid);
|
||||
}
|
||||
});
|
||||
connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged
|
||||
, this, &XWindowInterface::currentDesktopChanged);
|
||||
connect(m_activities.data(), &KActivities::Consumer::currentActivityChanged
|
||||
, this, &XWindowInterface::currentActivityChanged);
|
||||
|
||||
// fill windows list
|
||||
for (const auto &wid : KWindowSystem::self()->windows()) {
|
||||
addWindow(wid);
|
||||
}
|
||||
connect(m_activities.data(), &KActivities::Consumer::currentActivityChanged, this, &XWindowInterface::currentActivityChanged);
|
||||
}
|
||||
|
||||
XWindowInterface::~XWindowInterface()
|
||||
@ -172,11 +151,6 @@ WindowId XWindowInterface::activeWindow() const
|
||||
return KWindowSystem::self()->activeWindow();
|
||||
}
|
||||
|
||||
const std::list<WindowId> &XWindowInterface::windows() const
|
||||
{
|
||||
return m_windows;
|
||||
}
|
||||
|
||||
void XWindowInterface::setKeepAbove(const QDialog &dialog, bool above) const
|
||||
{
|
||||
if (above) {
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
WindowInfoWrap requestInfoActive() const override;
|
||||
bool isOnCurrentDesktop(WindowId wid) const override;
|
||||
bool isOnCurrentActivity(WindowId wid) const override;
|
||||
const std::list<WindowId> &windows() const override;
|
||||
|
||||
void setKeepAbove(const QDialog &dialog, bool above = true) const override;
|
||||
void skipTaskBar(const QDialog &dialog) const override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user