desktop grid: zoom hovered window
To indicate that the window is "active" ie. can be dragged or activated (like in present windows) There was either a bug or a forum post complaining about the inability to activate windows from DG
This commit is contained in:
parent
d1cf29f6b2
commit
14d1fdf63f
2 changed files with 20 additions and 0 deletions
|
@ -55,6 +55,7 @@ DesktopGridEffect::DesktopGridEffect()
|
||||||
, wasDesktopMove(false)
|
, wasDesktopMove(false)
|
||||||
, isValidMove(false)
|
, isValidMove(false)
|
||||||
, windowMove(NULL)
|
, windowMove(NULL)
|
||||||
|
, m_highlightWindow(nullptr)
|
||||||
, windowMoveDiff()
|
, windowMoveDiff()
|
||||||
, gridSize()
|
, gridSize()
|
||||||
, orientation(Qt::Horizontal)
|
, orientation(Qt::Horizontal)
|
||||||
|
@ -283,8 +284,14 @@ 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 xScale = data.xScale();
|
||||||
qreal yScale = data.yScale();
|
qreal yScale = data.yScale();
|
||||||
|
if (zoom) {
|
||||||
|
xScale *= 1.05f;
|
||||||
|
yScale *= 1.05f;
|
||||||
|
}
|
||||||
|
|
||||||
// Don't change brightness of windows on all desktops as this causes flickering
|
// Don't change brightness of windows on all desktops as this causes flickering
|
||||||
if (!w->isOnAllDesktops() || w->isDesktop())
|
if (!w->isOnAllDesktops() || w->isDesktop())
|
||||||
|
@ -312,6 +319,10 @@ void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, W
|
||||||
} else if (w->screen() != screen)
|
} else if (w->screen() != screen)
|
||||||
quadsAdded = true; // we don't want parts of overlapping windows on the other screen
|
quadsAdded = true; // we don't want parts of overlapping windows on the other screen
|
||||||
}
|
}
|
||||||
|
if (zoom) {
|
||||||
|
transformedGeo.translate(-0.025f*transformedGeo.width(),
|
||||||
|
-0.025f*transformedGeo.height());
|
||||||
|
}
|
||||||
if (!quadsAdded) {
|
if (!quadsAdded) {
|
||||||
foreach (const WindowQuad & quad, data.quads) {
|
foreach (const WindowQuad & quad, data.quads) {
|
||||||
QRect quadRect(
|
QRect quadRect(
|
||||||
|
@ -474,6 +485,14 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e)
|
||||||
|
|
||||||
if (e->type() == QEvent::MouseMove) {
|
if (e->type() == QEvent::MouseMove) {
|
||||||
int d = posToDesktop(me->pos());
|
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 &&
|
if (windowMove != NULL &&
|
||||||
(me->pos() - dragStartPos).manhattanLength() > QApplication::startDragDistance()) {
|
(me->pos() - dragStartPos).manhattanLength() > QApplication::startDragDistance()) {
|
||||||
// Handle window moving
|
// Handle window moving
|
||||||
|
|
|
@ -154,6 +154,7 @@ private:
|
||||||
bool keyboardGrab;
|
bool keyboardGrab;
|
||||||
bool wasWindowMove, wasDesktopMove, isValidMove;
|
bool wasWindowMove, wasDesktopMove, isValidMove;
|
||||||
EffectWindow* windowMove;
|
EffectWindow* windowMove;
|
||||||
|
EffectWindow* m_highlightWindow;
|
||||||
QPoint windowMoveDiff;
|
QPoint windowMoveDiff;
|
||||||
QPoint dragStartPos;
|
QPoint dragStartPos;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue