Revert "desktop grid: zoom hovered window"
Summary:
This reverts commit 14d1fdf63f
.
The zoom effect is definitely the wrong way, it's broken (can be
triggered without moving the mouse, expands windows outside of their
allotted area (looks like broken sizing/placement), isn't animated so
feels very choppy, isn't using well-known highlight semantics), the
result is that it feels unnatural and jarring. To be honest, when I
looked at it, I was looking for a bug in the code, e.g. margins not
being taken into account. It didn't come up in me that this could be
wanted behavior, until I read the code.
As to the original commit message: The highlight is useless for this
case, as any window can be dragged or activated, highlighted or not.
What *could* work is to somehow intensify the colors, but that again
would have to be animated, and play well with the ongoing desktop-zoom
animation, the mouse pointer location changes relative to the window, so
it's really complex to get right. I thought of this for a while, I don't
think the complexity that has to be implemented is worth the benefit,
because, what does highlighted really mean here? "window is under the
mouse" isn't a useful metric, as we don't know if the user is changing
desktops or rearranging windows, and "window under mouse" changes
depending on the zoom level, "window can be dragged or activated" also
isn't a useful metric, as I can do that with any window, anyway.
Test Plan: Tested with patch applied, desktopgrid windows don't jump around anymore.
Reviewers: graesslin
Reviewed By: graesslin
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1209
This commit is contained in:
parent
a9fad7396e
commit
5fecaf3fe7
2 changed files with 0 additions and 20 deletions
|
@ -55,7 +55,6 @@ DesktopGridEffect::DesktopGridEffect()
|
|||
, wasDesktopMove(false)
|
||||
, isValidMove(false)
|
||||
, windowMove(NULL)
|
||||
, m_highlightWindow(nullptr)
|
||||
, windowMoveDiff()
|
||||
, gridSize()
|
||||
, orientation(Qt::Horizontal)
|
||||
|
@ -284,14 +283,8 @@ void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, W
|
|||
}
|
||||
}
|
||||
|
||||
const bool isOnThisDesktop = !w->isOnAllDesktops() || paintingDesktop == highlightedDesktop;
|
||||
const bool zoom = w == m_highlightWindow && isOnThisDesktop;
|
||||
qreal xScale = data.xScale();
|
||||
qreal yScale = data.yScale();
|
||||
if (zoom) {
|
||||
xScale *= 1.05f;
|
||||
yScale *= 1.05f;
|
||||
}
|
||||
|
||||
data.multiplyBrightness(1.0 - (0.3 * (1.0 - hoverTimeline[paintingDesktop - 1]->currentValue())));
|
||||
|
||||
|
@ -316,10 +309,6 @@ void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, W
|
|||
if (w->isDesktop())
|
||||
quadsAdded = false;
|
||||
}
|
||||
if (zoom) {
|
||||
transformedGeo.translate(-0.025f*transformedGeo.width(),
|
||||
-0.025f*transformedGeo.height());
|
||||
}
|
||||
if (!quadsAdded) {
|
||||
foreach (const WindowQuad & quad, data.quads) {
|
||||
QRect quadRect(
|
||||
|
@ -466,14 +455,6 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e)
|
|||
|
||||
if (e->type() == QEvent::MouseMove) {
|
||||
int d = posToDesktop(me->pos());
|
||||
if (!(wasDesktopMove || wasWindowMove)) {
|
||||
EffectWindow *oldHighlightWindow = m_highlightWindow;
|
||||
m_highlightWindow = windowAt(me->pos());
|
||||
if (m_highlightWindow && m_highlightWindow->isDesktop())
|
||||
m_highlightWindow = nullptr;
|
||||
if (oldHighlightWindow != m_highlightWindow)
|
||||
effects->addRepaintFull();
|
||||
}
|
||||
if (windowMove != NULL &&
|
||||
(me->pos() - dragStartPos).manhattanLength() > QApplication::startDragDistance()) {
|
||||
// Handle window moving
|
||||
|
|
|
@ -155,7 +155,6 @@ private:
|
|||
bool keyboardGrab;
|
||||
bool wasWindowMove, wasDesktopMove, isValidMove;
|
||||
EffectWindow* windowMove;
|
||||
EffectWindow* m_highlightWindow;
|
||||
QPoint windowMoveDiff;
|
||||
QPoint dragStartPos;
|
||||
|
||||
|
|
Loading…
Reference in a new issue