New ScreenEdge triggering behavior for RealFloats

--trying an alternative approach concerning real floating
Views and screen edge triggering. In such case the user
has triggered to show a REAL FLOATING VIEW, it is considered
normal from user point of view for the view to remain shown
until there is windows changed state or the mouse has
escaped the View main window area
pull/11/head
Michail Vourlakos 5 years ago
parent a9d4f91c05
commit 9d6e350a85

@ -643,6 +643,11 @@ void View::setInEditMode(bool edit)
emit inEditModeChanged(); emit inEditModeChanged();
} }
bool View::isFloatingWindow() const
{
return m_behaveAsPlasmaPanel && m_screenEdgeMarginEnabled && (m_screenEdgeMargin>0);
}
bool View::isPreferredForShortcuts() const bool View::isPreferredForShortcuts() const
{ {
return m_isPreferredForShortcuts; return m_isPreferredForShortcuts;

@ -150,6 +150,8 @@ public:
bool inEditMode() const; bool inEditMode() const;
void setInEditMode(bool edit); void setInEditMode(bool edit);
bool isFloatingWindow() const;
bool isPreferredForShortcuts() const; bool isPreferredForShortcuts() const;
void setIsPreferredForShortcuts(bool preferred); void setIsPreferredForShortcuts(bool preferred);

@ -57,8 +57,16 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view)
m_corona = qobject_cast<Latte::Corona *>(view->corona()); m_corona = qobject_cast<Latte::Corona *>(view->corona());
m_wm = m_corona->wm(); m_wm = m_corona->wm();
connect(this, &VisibilityManager::slideInFinished, this, &VisibilityManager::updateHiddenState);
connect(this, &VisibilityManager::slideOutFinished, this, &VisibilityManager::updateHiddenState); connect(this, &VisibilityManager::slideOutFinished, this, &VisibilityManager::updateHiddenState);
connect(this, &VisibilityManager::slideInFinished, this, [&]() {
if (m_latteView && !m_latteView->isFloatingWindow()) {
//! after slide-out the real floating windows should ignore their criteria
//! until containsMouse from view has been set to true and false to afterwards
updateHiddenState();
} else {
m_timerHide.stop();
}
});
connect(this, &VisibilityManager::enableKWinEdgesChanged, this, &VisibilityManager::updateKWinEdgesSupport); connect(this, &VisibilityManager::enableKWinEdgesChanged, this, &VisibilityManager::updateKWinEdgesSupport);
connect(this, &VisibilityManager::modeChanged, this, &VisibilityManager::updateKWinEdgesSupport); connect(this, &VisibilityManager::modeChanged, this, &VisibilityManager::updateKWinEdgesSupport);
@ -477,13 +485,13 @@ void VisibilityManager::updateGhostWindowState()
if (m_mode == Latte::Types::WindowsCanCover) { if (m_mode == Latte::Types::WindowsCanCover) {
m_wm->setActiveEdge(m_edgeGhostWindow, m_isBelowLayer && !m_containsMouse); m_wm->setActiveEdge(m_edgeGhostWindow, m_isBelowLayer && !m_containsMouse);
} else { } else {
bool viewIsFloatingAndContainsMouse = /* bool viewIsFloatingAndContainsMouse =
m_latteView->behaveAsPlasmaPanel() m_latteView->behaveAsPlasmaPanel()
&& m_latteView->screenEdgeMarginEnabled() && m_latteView->screenEdgeMarginEnabled()
&& m_latteView->screenEdgeMargin()>0 && m_latteView->screenEdgeMargin()>0
&& (m_edgeGhostWindow->containsMouse() || m_containsMouse); && (m_edgeGhostWindow->containsMouse() || m_containsMouse);*/
bool activated = (m_isHidden && !m_containsMouse) || viewIsFloatingAndContainsMouse; bool activated = (m_isHidden && !m_containsMouse); /*|| viewIsFloatingAndContainsMouse;*/
m_wm->setActiveEdge(m_edgeGhostWindow, activated); m_wm->setActiveEdge(m_edgeGhostWindow, activated);
} }

Loading…
Cancel
Save