From f2a90aafe6645c775234c5d3cc95da7f008cc9d2 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 6 Dec 2018 16:09:42 +0200 Subject: [PATCH] refactor:rename dock term to view term --- app/infoview.cpp | 2 +- app/view/dockconfigview.cpp | 4 ++-- app/view/docksecconfigview.cpp | 2 +- app/view/screenedgeghostwindow.cpp | 4 ++-- app/view/screenedgeghostwindow.h | 4 ++-- app/view/visibilitymanager.cpp | 22 +++++++++++----------- app/wm/abstractwindowinterface.cpp | 12 ++++++------ app/wm/abstractwindowinterface.h | 12 ++++++------ app/wm/waylandinterface.cpp | 18 +++++++++--------- app/wm/waylandinterface.h | 6 +++--- app/wm/xwindowinterface.cpp | 10 +++++----- app/wm/xwindowinterface.h | 6 +++--- 12 files changed, 51 insertions(+), 51 deletions(-) diff --git a/app/infoview.cpp b/app/infoview.cpp index 4a5c28bbe..f3d051822 100644 --- a/app/infoview.cpp +++ b/app/infoview.cpp @@ -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); diff --git a/app/view/dockconfigview.cpp b/app/view/dockconfigview.cpp index b5a783a40..e4c7bbce5 100644 --- a/app/view/dockconfigview.cpp +++ b/app/view/dockconfigview.cpp @@ -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); diff --git a/app/view/docksecconfigview.cpp b/app/view/docksecconfigview.cpp index 52445e5f7..6a2b778ff 100644 --- a/app/view/docksecconfigview.cpp +++ b/app/view/docksecconfigview.cpp @@ -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); diff --git a/app/view/screenedgeghostwindow.cpp b/app/view/screenedgeghostwindow.cpp index e44a133fd..cf30f9673 100644 --- a/app/view/screenedgeghostwindow.cpp +++ b/app/view/screenedgeghostwindow.cpp @@ -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; } diff --git a/app/view/screenedgeghostwindow.h b/app/view/screenedgeghostwindow.h index 29266e54c..f10c293f3 100644 --- a/app/view/screenedgeghostwindow.h +++ b/app/view/screenedgeghostwindow.h @@ -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(); diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 0fe98b501..8a298bf27 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -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) { diff --git a/app/wm/abstractwindowinterface.cpp b/app/wm/abstractwindowinterface.cpp index 5a3180d16..d19b23d72 100644 --- a/app/wm/abstractwindowinterface.cpp +++ b/app/wm/abstractwindowinterface.cpp @@ -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); } diff --git a/app/wm/abstractwindowinterface.h b/app/wm/abstractwindowinterface.h index cea39643b..0f3179b3f 100644 --- a/app/wm/abstractwindowinterface.h +++ b/app/wm/abstractwindowinterface.h @@ -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 m_windows; - std::list m_docks; + std::list m_views; QPointer m_activities; private slots: diff --git a/app/wm/waylandinterface.cpp b/app/wm/waylandinterface.cpp index 7024a369f..8daa58d5d 100644 --- a/app/wm/waylandinterface.cpp +++ b/app/wm/waylandinterface.cpp @@ -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(); } diff --git a/app/wm/waylandinterface.h b/app/wm/waylandinterface.h index fea3e25c0..cf16c91dc 100644 --- a/app/wm/waylandinterface.h +++ b/app/wm/waylandinterface.h @@ -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; diff --git a/app/wm/xwindowinterface.cpp b/app/wm/xwindowinterface.cpp index 748b58417..5a6edc6b5 100644 --- a/app/wm/xwindowinterface.cpp +++ b/app/wm/xwindowinterface.cpp @@ -82,7 +82,7 @@ XWindowInterface::~XWindowInterface() { } -void XWindowInterface::setDockExtraFlags(QWindow &view) +void XWindowInterface::setViewExtraFlags(QWindow &view) { NETWinInfo winfo(QX11Info::connection() , static_cast(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); diff --git a/app/wm/xwindowinterface.h b/app/wm/xwindowinterface.h index 0255b6bdd..518402715 100644 --- a/app/wm/xwindowinterface.h +++ b/app/wm/xwindowinterface.h @@ -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;