fix #164, Dodge Active is broken for windows on all desktops

pull/1/head
Johan Smith Agudelo Rodriguez 8 years ago
parent 827bde86d4
commit c17732cf17

@ -63,7 +63,7 @@ signals:
void windowChanged(WId winfo); void windowChanged(WId winfo);
void windowAdded(WId wid); void windowAdded(WId wid);
void windowRemoved(WId wid); void windowRemoved(WId wid);
void currentDesktopChanged(int desktop); void currentDesktopChanged();
void currentActivityChanged(); void currentActivityChanged();
protected: protected:

@ -36,8 +36,6 @@ XWindowInterface::XWindowInterface(QQuickWindow *const view, QObject *parent)
{ {
Q_ASSERT(view != nullptr); Q_ASSERT(view != nullptr);
m_currentDesktop = KWindowSystem::currentDesktop();
connections << connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged connections << connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged
, this, &AbstractWindowInterface::activeWindowChanged); , this, &AbstractWindowInterface::activeWindowChanged);
connections << connect(KWindowSystem::self() connections << connect(KWindowSystem::self()
@ -60,11 +58,7 @@ XWindowInterface::XWindowInterface(QQuickWindow *const view, QObject *parent)
} }
}); });
connections << connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged connections << connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged
, this, [&](int desktop) { , this, &XWindowInterface::currentDesktopChanged);
m_currentDesktop = desktop;
emit currentDesktopChanged(m_currentDesktop);
});
connections << connect(activities.data(), &KActivities::Consumer::currentActivityChanged connections << connect(activities.data(), &KActivities::Consumer::currentActivityChanged
, this, &XWindowInterface::currentActivityChanged); , this, &XWindowInterface::currentActivityChanged);
@ -166,7 +160,7 @@ WindowInfoWrap XWindowInterface::requestInfoActive() const
bool XWindowInterface::isOnCurrentDesktop(WId wid) const bool XWindowInterface::isOnCurrentDesktop(WId wid) const
{ {
KWindowInfo winfo(wid, NET::WMDesktop); KWindowInfo winfo(wid, NET::WMDesktop);
return winfo.valid() && winfo.desktop() == m_currentDesktop; return winfo.valid() && winfo.isOnCurrentDesktop();
} }
WindowInfoWrap XWindowInterface::requestInfo(WId wid) const WindowInfoWrap XWindowInterface::requestInfo(WId wid) const

@ -56,7 +56,6 @@ private:
void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2); void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2);
WId m_desktopId; WId m_desktopId;
int m_currentDesktop;
QPointer<KActivities::Consumer> activities; QPointer<KActivities::Consumer> activities;
QList<QMetaObject::Connection> connections; QList<QMetaObject::Connection> connections;

Loading…
Cancel
Save