fixes for identifying Unity vertical view showing

--more specific identifying properly when a vertical
view is shown and is touching a top or bottom view
that has requested to be fully trasparent when no
maximized window exists
pull/20/head
Michail Vourlakos 5 years ago
parent 5e50147848
commit 5af3036613

@ -727,49 +727,58 @@ bool Windows::isTouchingView(Latte::View *view, const WindowSystem::WindowInfoWr
return (winfo.isValid() && intersects(view, winfo));
}
bool Windows::isTouchingViewEdge(Latte::View *view, const WindowInfoWrap &winfo)
bool Windows::isTouchingViewEdge(Latte::View *view, const QRect &windowgeometry)
{
if (winfo.isValid() && !winfo.isMinimized()) {
bool inViewThicknessEdge{false};
bool inViewLengthBoundaries{false};
QRect screenGeometry = view->screenGeometry();
bool inCurrentScreen{screenGeometry.contains(winfo.geometry().topLeft()) || screenGeometry.contains(winfo.geometry().bottomRight())};
if (inCurrentScreen) {
if (view->location() == Plasma::Types::TopEdge) {
inViewThicknessEdge = (winfo.geometry().y() == view->absoluteGeometry().bottom() + 1);
} else if (view->location() == Plasma::Types::BottomEdge) {
inViewThicknessEdge = (winfo.geometry().bottom() == view->absoluteGeometry().top() - 1);
} else if (view->location() == Plasma::Types::LeftEdge) {
inViewThicknessEdge = (winfo.geometry().x() == view->absoluteGeometry().right() + 1);
} else if (view->location() == Plasma::Types::RightEdge) {
inViewThicknessEdge = (winfo.geometry().right() == view->absoluteGeometry().left() - 1);
}
if (!view) {
return false;
}
if (view->formFactor() == Plasma::Types::Horizontal) {
int yCenter = view->absoluteGeometry().center().y();
bool inViewThicknessEdge{false};
bool inViewLengthBoundaries{false};
QPoint leftChecker(winfo.geometry().left(), yCenter);
QPoint rightChecker(winfo.geometry().right(), yCenter);
QRect screenGeometry = view->screenGeometry();
bool fulloverlap = (winfo.geometry().left()<=view->absoluteGeometry().left()) && (winfo.geometry().right()>=view->absoluteGeometry().right());
bool inCurrentScreen{screenGeometry.contains(windowgeometry.topLeft()) || screenGeometry.contains(windowgeometry.bottomRight())};
inViewLengthBoundaries = fulloverlap || view->absoluteGeometry().contains(leftChecker) || view->absoluteGeometry().contains(rightChecker);
} else if (view->formFactor() == Plasma::Types::Vertical) {
int xCenter = view->absoluteGeometry().center().x();
if (inCurrentScreen) {
if (view->location() == Plasma::Types::TopEdge) {
inViewThicknessEdge = (windowgeometry.y() == view->absoluteGeometry().bottom() + 1);
} else if (view->location() == Plasma::Types::BottomEdge) {
inViewThicknessEdge = (windowgeometry.bottom() == view->absoluteGeometry().top() - 1);
} else if (view->location() == Plasma::Types::LeftEdge) {
inViewThicknessEdge = (windowgeometry.x() == view->absoluteGeometry().right() + 1);
} else if (view->location() == Plasma::Types::RightEdge) {
inViewThicknessEdge = (windowgeometry.right() == view->absoluteGeometry().left() - 1);
}
QPoint topChecker(xCenter, winfo.geometry().top());
QPoint bottomChecker(xCenter, winfo.geometry().bottom());
if (view->formFactor() == Plasma::Types::Horizontal) {
int yCenter = view->absoluteGeometry().center().y();
bool fulloverlap = (winfo.geometry().top()<=view->absoluteGeometry().top()) && (winfo.geometry().bottom()>=view->absoluteGeometry().bottom());
QPoint leftChecker(windowgeometry.left(), yCenter);
QPoint rightChecker(windowgeometry.right(), yCenter);
inViewLengthBoundaries = fulloverlap || view->absoluteGeometry().contains(topChecker) || view->absoluteGeometry().contains(bottomChecker);
}
bool fulloverlap = (windowgeometry.left()<=view->absoluteGeometry().left()) && (windowgeometry.right()>=view->absoluteGeometry().right());
inViewLengthBoundaries = fulloverlap || view->absoluteGeometry().contains(leftChecker) || view->absoluteGeometry().contains(rightChecker);
} else if (view->formFactor() == Plasma::Types::Vertical) {
int xCenter = view->absoluteGeometry().center().x();
QPoint topChecker(xCenter, windowgeometry.top());
QPoint bottomChecker(xCenter, windowgeometry.bottom());
bool fulloverlap = (windowgeometry.top()<=view->absoluteGeometry().top()) && (windowgeometry.bottom()>=view->absoluteGeometry().bottom());
inViewLengthBoundaries = fulloverlap || view->absoluteGeometry().contains(topChecker) || view->absoluteGeometry().contains(bottomChecker);
}
}
return (inViewThicknessEdge && inViewLengthBoundaries);
}
return (inViewThicknessEdge && inViewLengthBoundaries);
bool Windows::isTouchingViewEdge(Latte::View *view, const WindowInfoWrap &winfo)
{
if (winfo.isValid() && !winfo.isMinimized()) {
return isTouchingViewEdge(view, winfo.geometry());
}
return false;
@ -839,8 +848,10 @@ void Windows::updateExtraViewHints()
bool sameScreen = (verView->positioner()->currentScreenId() == horView->positioner()->currentScreenId());
if (verView->formFactor() == Plasma::Types::Vertical && sameScreen) {
bool topTouch = verView->isTouchingTopViewAndIsBusy() && horView->location() == Plasma::Types::TopEdge;
bool bottomTouch = verView->isTouchingBottomViewAndIsBusy() && horView->location() == Plasma::Types::BottomEdge;
bool hasEdgeTouch = isTouchingViewEdge(horView, verView->absoluteGeometry());
bool topTouch = horView->location() == Plasma::Types::TopEdge && verView->isTouchingTopViewAndIsBusy() && hasEdgeTouch;
bool bottomTouch = horView->location() == Plasma::Types::BottomEdge && verView->isTouchingBottomViewAndIsBusy() && hasEdgeTouch;
if (topTouch || bottomTouch) {
touchingBusyVerticalView = true;

@ -170,6 +170,7 @@ private:
bool isMaximizedInViewScreen(Latte::View *view, const WindowInfoWrap &winfo);
bool isTouchingView(Latte::View *view, const WindowSystem::WindowInfoWrap &winfo);
bool isTouchingViewEdge(Latte::View *view, const WindowInfoWrap &winfo);
bool isTouchingViewEdge(Latte::View *view, const QRect &windowgeometry);
private:
//! a timer in order to not overload the views extra hints checking because it is not

@ -237,9 +237,10 @@ Item{
}
var isTouchingTopScreenEdge = (latteView.y === latteView.screenGeometry.y);
var hasTopBorder = ((latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.TopBorder)) > 0);
var isStickedOnTopBorder = (plasmoid.configuration.alignment === LatteCore.Types.Justify && plasmoid.configuration.maxLength===100)
|| (plasmoid.configuration.alignment === LatteCore.Types.Top && plasmoid.configuration.offset===0);
return root.isVertical && !latteView.visibility.isHidden && !isTouchingTopScreenEdge && !hasTopBorder && background.isShown;
return root.isVertical && !latteView.visibility.isHidden && !isTouchingTopScreenEdge && isStickedOnTopBorder && background.isShown;
}
}
@ -256,9 +257,10 @@ Item{
var screenBottom = latteView.screenGeometry.y + latteView.screenGeometry.height;
var isTouchingBottomScreenEdge = (latteBottom === screenBottom);
var hasBottomBorder = ((latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.BottomBorder)) > 0);
var isStickedOnBottomBorder = (plasmoid.configuration.alignment === LatteCore.Types.Justify && plasmoid.configuration.maxLength===100)
|| (plasmoid.configuration.alignment === LatteCore.Types.Bottom && plasmoid.configuration.offset===0);
return root.isVertical && !latteView.visibility.isHidden && !isTouchingBottomScreenEdge && !hasBottomBorder && background.isShown;
return root.isVertical && !latteView.visibility.isHidden && !isTouchingBottomScreenEdge && isStickedOnBottomBorder && background.isShown;
}
}

@ -199,7 +199,6 @@ Item {
property bool normalBusyForTouchingBusyVerticalView: (latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers isBusy transparency*/
&& latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView
&& root.themeColors === LatteContainment.Types.SmartThemeColors
&& plasmoid.configuration.backgroundOnlyOnMaximized
/*&& !plasmoid.configuration.solidBackgroundForMaximized
&& !plasmaBackgroundForPopups*/)

Loading…
Cancel
Save