mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-12 01:17:55 +03:00
refactor:rename dock term to view term
This commit is contained in:
parent
185dd39e5c
commit
f2a90aafe6
@ -123,7 +123,7 @@ void InfoView::showEvent(QShowEvent *ev)
|
||||
{
|
||||
QQuickWindow::showEvent(ev);
|
||||
|
||||
m_corona->wm()->setDockExtraFlags(*this);
|
||||
m_corona->wm()->setViewExtraFlags(*this);
|
||||
setFlags(wFlags());
|
||||
|
||||
m_corona->wm()->enableBlurBehind(*this);
|
||||
|
@ -84,7 +84,7 @@ DockConfigView::DockConfigView(Plasma::Containment *containment, Latte::View *vi
|
||||
});
|
||||
|
||||
if (m_corona) {
|
||||
connections << connect(m_corona, SIGNAL(raiseDocksTemporaryChanged()), this, SIGNAL(raiseDocksTemporaryChanged()));
|
||||
connections << connect(m_corona, &Latte::Corona::raiseViewsTemporaryChanged, this, &DockConfigView::raiseDocksTemporaryChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ void DockConfigView::showEvent(QShowEvent *ev)
|
||||
{
|
||||
QQuickWindow::showEvent(ev);
|
||||
|
||||
m_corona->wm()->setDockExtraFlags(*this);
|
||||
m_corona->wm()->setViewExtraFlags(*this);
|
||||
setFlags(wFlags());
|
||||
|
||||
m_corona->wm()->enableBlurBehind(*this);
|
||||
|
@ -237,7 +237,7 @@ void DockSecConfigView::showEvent(QShowEvent *ev)
|
||||
{
|
||||
QQuickWindow::showEvent(ev);
|
||||
|
||||
m_corona->wm()->setDockExtraFlags(*this);
|
||||
m_corona->wm()->setViewExtraFlags(*this);
|
||||
setFlags(wFlags());
|
||||
|
||||
m_corona->wm()->enableBlurBehind(*this);
|
||||
|
@ -70,7 +70,7 @@ ScreenEdgeGhostWindow::ScreenEdgeGhostWindow(Latte::View *view) :
|
||||
|
||||
if (!KWindowSystem::isPlatformWayland()) {
|
||||
connect(this, &QWindow::visibleChanged, this, [&]() {
|
||||
//! IMPORTANT!!! ::: This fixes a bug when closing an Activity all docks from all Activities are
|
||||
//! IMPORTANT!!! ::: This fixes a bug when closing an Activity all views from all Activities are
|
||||
//! disappearing! With this they reappear!!!
|
||||
if (m_latteView && m_latteView->managedLayout()) {
|
||||
if (!isVisible()) {
|
||||
@ -121,7 +121,7 @@ int ScreenEdgeGhostWindow::location()
|
||||
return (int)m_latteView->location();
|
||||
}
|
||||
|
||||
Latte::View *ScreenEdgeGhostWindow::parentDock()
|
||||
Latte::View *ScreenEdgeGhostWindow::parentView()
|
||||
{
|
||||
return m_latteView;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace Latte {
|
||||
//! that arent relevant any more.
|
||||
//!
|
||||
//! In order to workaround the above behaviour Latte is using a
|
||||
//! fake window to communicate with KWin and the MAIN dock window
|
||||
//! fake window to communicate with KWin and the MAIN Latte::View window
|
||||
//! continues to use only mask technique to hide
|
||||
//!
|
||||
//! KDE BUGS: https://bugs.kde.org/show_bug.cgi?id=382219
|
||||
@ -67,7 +67,7 @@ public:
|
||||
void hideWithMask();
|
||||
void showWithMask();
|
||||
|
||||
Latte::View *parentDock();
|
||||
Latte::View *parentView();
|
||||
|
||||
KWayland::Client::PlasmaShellSurface *surface();
|
||||
|
||||
|
@ -72,16 +72,16 @@ VisibilityManagerPrivate::VisibilityManagerPrivate(PlasmaQuick::ContainmentView
|
||||
emit this->q->mustBeHide(VisibilityManager::QPrivateSignal{});
|
||||
}
|
||||
});
|
||||
wm->setDockExtraFlags(*view);
|
||||
wm->addDock(view->winId());
|
||||
wm->setViewExtraFlags(*view);
|
||||
wm->addView(view->winId());
|
||||
restoreConfig();
|
||||
}
|
||||
|
||||
VisibilityManagerPrivate::~VisibilityManagerPrivate()
|
||||
{
|
||||
qDebug() << "VisibilityManagerPrivate deleting...";
|
||||
wm->removeDockStruts(*view);
|
||||
wm->removeDock(view->winId());
|
||||
wm->removeViewStruts(*view);
|
||||
wm->removeView(view->winId());
|
||||
|
||||
if (edgeGhostWindow) {
|
||||
edgeGhostWindow->deleteLater();
|
||||
@ -105,7 +105,7 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
|
||||
}
|
||||
|
||||
if (this->mode == Dock::AlwaysVisible) {
|
||||
wm->removeDockStruts(*view);
|
||||
wm->removeViewStruts(*view);
|
||||
} else {
|
||||
connections[3] = connect(wm, &WindowSystem::currentDesktopChanged
|
||||
, this, [&] {
|
||||
@ -140,12 +140,12 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
|
||||
connections[0] = connect(view->containment(), &Plasma::Containment::locationChanged
|
||||
, this, [&]() {
|
||||
if (m_latteView->inEditMode())
|
||||
wm->removeDockStruts(*view);
|
||||
wm->removeViewStruts(*view);
|
||||
});
|
||||
connections[1] = connect(m_latteView, &Latte::View::inEditModeChanged
|
||||
, this, [&]() {
|
||||
if (!m_latteView->inEditMode() && !m_latteView->positioner()->inLocationChangeAnimation() && view->screen())
|
||||
wm->setDockStruts(*view, dockGeometry, view->containment()->location());
|
||||
wm->setViewStruts(*view, dockGeometry, view->containment()->location());
|
||||
});
|
||||
|
||||
if (m_corona && m_corona->layoutManager()->memoryUsage() == Dock::MultipleLayouts) {
|
||||
@ -254,9 +254,9 @@ void VisibilityManagerPrivate::updateStrutsBasedOnLayoutsAndActivities()
|
||||
&& m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName());
|
||||
|
||||
if (m_corona->layoutManager()->memoryUsage() == Dock::SingleLayout || multipleLayoutsAndCurrent) {
|
||||
wm->setDockStruts(*view, dockGeometry, view->location());
|
||||
wm->setViewStruts(*view, dockGeometry, view->location());
|
||||
} else {
|
||||
wm->removeDockStruts(*view);
|
||||
wm->removeViewStruts(*view);
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,7 +671,7 @@ void VisibilityManagerPrivate::viewEventManager(QEvent *ev)
|
||||
break;
|
||||
|
||||
case QEvent::Show:
|
||||
wm->setDockExtraFlags(*view);
|
||||
wm->setViewExtraFlags(*view);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1010,7 +1010,7 @@ void VisibilityManagerPrivate::createEdgeGhostWindow()
|
||||
if (!edgeGhostWindow) {
|
||||
edgeGhostWindow = new ScreenEdgeGhostWindow(m_latteView);
|
||||
|
||||
wm->setDockExtraFlags(*edgeGhostWindow);
|
||||
wm->setViewExtraFlags(*edgeGhostWindow);
|
||||
|
||||
connect(edgeGhostWindow, &ScreenEdgeGhostWindow::containsMouseChanged, this, [ = ](bool contains) {
|
||||
if (contains) {
|
||||
|
@ -71,17 +71,17 @@ AbstractWindowInterface::~AbstractWindowInterface()
|
||||
m_schemes.clear();
|
||||
}
|
||||
|
||||
void AbstractWindowInterface::addDock(WindowId wid)
|
||||
void AbstractWindowInterface::addView(WindowId wid)
|
||||
{
|
||||
m_docks.push_back(wid);
|
||||
m_views.push_back(wid);
|
||||
}
|
||||
|
||||
void AbstractWindowInterface::removeDock(WindowId wid)
|
||||
void AbstractWindowInterface::removeView(WindowId wid)
|
||||
{
|
||||
auto it = std::find(m_docks.begin(), m_docks.end(), wid);
|
||||
auto it = std::find(m_views.begin(), m_views.end(), wid);
|
||||
|
||||
if (it != m_docks.end())
|
||||
m_docks.erase(it);
|
||||
if (it != m_views.end())
|
||||
m_views.erase(it);
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,12 +69,12 @@ public:
|
||||
explicit AbstractWindowInterface(QObject *parent = nullptr);
|
||||
virtual ~AbstractWindowInterface();
|
||||
|
||||
virtual void setDockExtraFlags(QWindow &view) = 0;
|
||||
virtual void setDockStruts(QWindow &view, const QRect &rect
|
||||
virtual void setViewExtraFlags(QWindow &view) = 0;
|
||||
virtual void setViewStruts(QWindow &view, const QRect &rect
|
||||
, Plasma::Types::Location location) = 0;
|
||||
virtual void setWindowOnActivities(QWindow &window, const QStringList &activities) = 0;
|
||||
|
||||
virtual void removeDockStruts(QWindow &view) const = 0;
|
||||
virtual void removeViewStruts(QWindow &view) const = 0;
|
||||
|
||||
virtual WindowId activeWindow() const = 0;
|
||||
virtual WindowInfoWrap requestInfo(WindowId wid) const = 0;
|
||||
@ -93,8 +93,8 @@ public:
|
||||
virtual void requestMoveWindow(WindowId wid, QPoint from) const = 0;
|
||||
virtual bool windowCanBeDragged(WindowId wid) const = 0;
|
||||
|
||||
void addDock(WindowId wid);
|
||||
void removeDock(WindowId wid);
|
||||
void addView(WindowId wid);
|
||||
void removeView(WindowId wid);
|
||||
|
||||
SchemeColors *schemeForWindow(WindowId wId);
|
||||
void setColorSchemeForWindow(WindowId wId, QString scheme);
|
||||
@ -109,7 +109,7 @@ signals:
|
||||
|
||||
protected:
|
||||
std::list<WindowId> m_windows;
|
||||
std::list<WindowId> m_docks;
|
||||
std::list<WindowId> m_views;
|
||||
QPointer<KActivities::Consumer> m_activities;
|
||||
|
||||
private slots:
|
||||
|
@ -132,12 +132,12 @@ KWayland::Client::PlasmaShell *WaylandInterface::waylandCoronaInterface() const
|
||||
return m_corona->waylandCoronaInterface();
|
||||
}
|
||||
|
||||
void WaylandInterface::setDockExtraFlags(QWindow &view)
|
||||
void WaylandInterface::setViewExtraFlags(QWindow &view)
|
||||
{
|
||||
Q_UNUSED(view)
|
||||
}
|
||||
|
||||
void WaylandInterface::setDockStruts(QWindow &view, const QRect &rect, Plasma::Types::Location location)
|
||||
void WaylandInterface::setViewStruts(QWindow &view, const QRect &rect, Plasma::Types::Location location)
|
||||
{
|
||||
if (!m_ghostWindows.contains(view.winId()))
|
||||
m_ghostWindows[view.winId()] = new Private::GhostWindow(this);
|
||||
@ -167,7 +167,7 @@ void WaylandInterface::setWindowOnActivities(QWindow &window, const QStringList
|
||||
// KWindowSystem::setOnActivities(view.winId(), activities);
|
||||
}
|
||||
|
||||
void WaylandInterface::removeDockStruts(QWindow &view) const
|
||||
void WaylandInterface::removeViewStruts(QWindow &view) const
|
||||
{
|
||||
delete m_ghostWindows.take(view.winId());
|
||||
}
|
||||
@ -243,11 +243,11 @@ void WaylandInterface::setEdgeStateFor(QWindow *view, bool active) const
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->parentDock()->surface() && window->parentDock()->visibility()
|
||||
&& (window->parentDock()->visibility()->mode() == Dock::DodgeActive
|
||||
|| window->parentDock()->visibility()->mode() == Dock::DodgeMaximized
|
||||
|| window->parentDock()->visibility()->mode() == Dock::DodgeAllWindows
|
||||
|| window->parentDock()->visibility()->mode() == Dock::AutoHide)) {
|
||||
if (window->parentView()->surface() && window->parentView()->visibility()
|
||||
&& (window->parentView()->visibility()->mode() == Dock::DodgeActive
|
||||
|| window->parentView()->visibility()->mode() == Dock::DodgeMaximized
|
||||
|| window->parentView()->visibility()->mode() == Dock::DodgeAllWindows
|
||||
|| window->parentView()->visibility()->mode() == Dock::AutoHide)) {
|
||||
if (active) {
|
||||
window->showWithMask();
|
||||
window->surface()->requestHideAutoHidingPanel();
|
||||
@ -396,7 +396,7 @@ inline bool WaylandInterface::isValidWindow(const KWayland::Client::PlasmaWindow
|
||||
//! a trick is to just consider windows as valid when they can be shown in the
|
||||
//! taskbar. Of course that creates issues with plasma native dialogs
|
||||
//! e.g. widgets explorer, Activities etc. that are not used to hide
|
||||
//! the dodge docks/panels appropriately
|
||||
//! the dodge views appropriately
|
||||
return w->isValid() && !w->skipTaskbar();
|
||||
}
|
||||
|
||||
|
@ -58,12 +58,12 @@ public:
|
||||
explicit WaylandInterface(QObject *parent = nullptr);
|
||||
~WaylandInterface() override;
|
||||
|
||||
void setDockExtraFlags(QWindow &view) override;
|
||||
void setDockStruts(QWindow &view, const QRect &rect
|
||||
void setViewExtraFlags(QWindow &view) override;
|
||||
void setViewStruts(QWindow &view, const QRect &rect
|
||||
, Plasma::Types::Location location) override;
|
||||
void setWindowOnActivities(QWindow &view, const QStringList &activities) override;
|
||||
|
||||
void removeDockStruts(QWindow &view) const override;
|
||||
void removeViewStruts(QWindow &view) const override;
|
||||
|
||||
WindowId activeWindow() const override;
|
||||
WindowInfoWrap requestInfo(WindowId wid) const override;
|
||||
|
@ -82,7 +82,7 @@ XWindowInterface::~XWindowInterface()
|
||||
{
|
||||
}
|
||||
|
||||
void XWindowInterface::setDockExtraFlags(QWindow &view)
|
||||
void XWindowInterface::setViewExtraFlags(QWindow &view)
|
||||
{
|
||||
NETWinInfo winfo(QX11Info::connection()
|
||||
, static_cast<xcb_window_t>(view.winId())
|
||||
@ -95,7 +95,7 @@ void XWindowInterface::setDockExtraFlags(QWindow &view)
|
||||
KWindowSystem::setOnAllDesktops(view.winId(), true);
|
||||
}
|
||||
|
||||
void XWindowInterface::setDockStruts(QWindow &view, const QRect &rect
|
||||
void XWindowInterface::setViewStruts(QWindow &view, const QRect &rect
|
||||
, Plasma::Types::Location location)
|
||||
{
|
||||
NETExtendedStrut strut;
|
||||
@ -156,7 +156,7 @@ void XWindowInterface::setWindowOnActivities(QWindow &window, const QStringList
|
||||
KWindowSystem::setOnActivities(window.winId(), activities);
|
||||
}
|
||||
|
||||
void XWindowInterface::removeDockStruts(QWindow &view) const
|
||||
void XWindowInterface::removeViewStruts(QWindow &view) const
|
||||
{
|
||||
KWindowSystem::setStrut(view.winId(), 0, 0, 0, 0);
|
||||
}
|
||||
@ -394,8 +394,8 @@ bool XWindowInterface::isValidWindow(const KWindowInfo &winfo) const
|
||||
|
||||
void XWindowInterface::windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2)
|
||||
{
|
||||
//! if the dock changed is ignored
|
||||
if (std::find(m_docks.cbegin(), m_docks.cend(), wid) != m_docks.cend())
|
||||
//! if the view changed is ignored
|
||||
if (std::find(m_views.cbegin(), m_views.cend(), wid) != m_views.cend())
|
||||
return;
|
||||
|
||||
const auto winType = KWindowInfo(wid, NET::WMWindowType).windowType(NET::DesktopMask);
|
||||
|
@ -42,12 +42,12 @@ public:
|
||||
explicit XWindowInterface(QObject *parent = nullptr);
|
||||
~XWindowInterface() override;
|
||||
|
||||
void setDockExtraFlags(QWindow &view) override;
|
||||
void setDockStruts(QWindow &view, const QRect &rect
|
||||
void setViewExtraFlags(QWindow &view) override;
|
||||
void setViewStruts(QWindow &view, const QRect &rect
|
||||
, Plasma::Types::Location location) override;
|
||||
void setWindowOnActivities(QWindow &window, const QStringList &activities) override;
|
||||
|
||||
void removeDockStruts(QWindow &view) const override;
|
||||
void removeViewStruts(QWindow &view) const override;
|
||||
|
||||
WindowId activeWindow() const override;
|
||||
WindowInfoWrap requestInfo(WindowId wid) const override;
|
||||
|
Loading…
Reference in New Issue
Block a user