DodgeMaximized is functional

pull/1/head
Johan Smith Agudelo Rodriguez 8 years ago
parent 44d85a4905
commit 35c44a6918

@ -367,12 +367,12 @@ void VisibilityManagerPrivate::dodgeMaximized(WindowId wid)
auto isMaxVert = [&]() noexcept -> bool {
return winfo.isMaxVert()
|| (view->screen() && view->screen()->size().height() <= winfo.geometry().height());
|| (view->screen() && view->screen()->availableSize().height() <= winfo.geometry().height() && intersects(winfo));
};
auto isMaxHoriz = [&]() noexcept -> bool {
return winfo.isMaxHoriz()
|| (view->screen() && view->screen()->size().width() <= winfo.geometry().width());
|| (view->screen() && view->screen()->availableSize().width() <= winfo.geometry().width() && intersects(winfo));
};
if (wm->isOnCurrentDesktop(wid) && !winfo.isMinimized() && intersects(winfo))

@ -73,7 +73,10 @@ WaylandInterface::WaylandInterface(QObject *parent)
connect(m_wm, &PlasmaWindowManagement::windowCreated, this, &WaylandInterface::windowCreatedProxy);
connect(m_wm, &PlasmaWindowManagement::activeWindowChanged, this, [&]() {
auto w{m_wm->activeWindow()};
emit activeWindowChanged(w ? w->internalId() : 0);
if (w)
emit activeWindowChanged(w->internalId());
else
emit activeWindowChanged(0);
}, Qt::QueuedConnection);
@ -253,6 +256,8 @@ bool WaylandInterface::isOnCurrentDesktop(WindowId wid) const
return w->isValid() && w->internalId() == wid;
});
//qDebug() << "desktop:" << (it != m_wm->windows().constEnd() ? (*it)->virtualDesktop() : -1) << KWindowSystem::currentDesktop();
//return true;
return it != m_wm->windows().constEnd() && ( (*it)->virtualDesktop() == KWindowSystem::currentDesktop() || (*it)->isOnAllDesktops());
}
@ -306,13 +311,16 @@ void WaylandInterface::windowCreatedProxy(KWayland::Client::PlasmaWindow *w)
connect(w, SIGNAL(fullscreenChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(geometryChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(maximizedChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(onAllDesktopsChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(minimizedChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(shadedChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(skipTaskBarChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(onAllDesktopsChanged()), mapper, SLOT(map()));
connect(w, SIGNAL(virtualDesktopChanged()), mapper, SLOT(map()));
connect(mapper, static_cast<void (QSignalMapper::*)(QObject *)>(&QSignalMapper::mapped)
, this, [&](QObject *w)
{
qDebug() << "window changed:" << qobject_cast<PlasmaWindow *>(w)->appId();
emit windowChanged(qobject_cast<PlasmaWindow *>(w)->internalId());
});

Loading…
Cancel
Save