EffectWindow::geometry -> EffectWindow::frameGeometry
::geometry is deprecated.
This commit is contained in:
parent
bf2e54fb5e
commit
84200e7e38
17 changed files with 76 additions and 76 deletions
|
@ -586,7 +586,7 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, const QRegion ®ion, Wi
|
|||
const bool transientForIsDock = (modal ? modal->isDock() : false);
|
||||
|
||||
if (!shape.isEmpty()) {
|
||||
doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(), w->isDock() || transientForIsDock, w->geometry());
|
||||
doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(), w->isDock() || transientForIsDock, w->frameGeometry());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -609,7 +609,7 @@ void CoverSwitchEffect::slotTabBoxUpdated()
|
|||
|
||||
void CoverSwitchEffect::paintWindowCover(EffectWindow* w, bool reflectedWindow, WindowPaintData& data)
|
||||
{
|
||||
QRect windowRect = w->geometry();
|
||||
QRect windowRect = w->frameGeometry();
|
||||
data.setYTranslation(area.height() - windowRect.y() - windowRect.height());
|
||||
data.setZTranslation(-zPosition);
|
||||
if (start) {
|
||||
|
@ -704,7 +704,7 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i
|
|||
data.setProjectionMatrix(m_projectionMatrix);
|
||||
data.setModelViewMatrix(m_modelviewMatrix);
|
||||
}
|
||||
data.setXTranslation(area.width() * 0.5 - frontWindow->geometry().x() - frontWindow->geometry().width() * 0.5);
|
||||
data.setXTranslation(area.width() * 0.5 - frontWindow->frameGeometry().x() - frontWindow->frameGeometry().width() * 0.5);
|
||||
if (leftWindows == 0) {
|
||||
leftWindows = 1;
|
||||
if (!start && !stop)
|
||||
|
@ -718,15 +718,15 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i
|
|||
const QSize screenSize = effects->virtualScreenSize();
|
||||
if (direction == Right) {
|
||||
// move to right
|
||||
distance = -frontWindow->geometry().width() * 0.5f + area.width() * 0.5f +
|
||||
distance = -frontWindow->frameGeometry().width() * 0.5f + area.width() * 0.5f +
|
||||
(((float)screenSize.width() * 0.5 * scaleFactor) - (float)area.width() * 0.5f) / rightWindows;
|
||||
data.translate(distance * timeLine.value());
|
||||
data.setRotationAxis(Qt::YAxis);
|
||||
data.setRotationAngle(-angle * timeLine.value());
|
||||
data.setRotationOrigin(QVector3D(frontWindow->geometry().width(), 0.0, 0.0));
|
||||
data.setRotationOrigin(QVector3D(frontWindow->frameGeometry().width(), 0.0, 0.0));
|
||||
} else {
|
||||
// move to left
|
||||
distance = frontWindow->geometry().width() * 0.5f - area.width() * 0.5f +
|
||||
distance = frontWindow->frameGeometry().width() * 0.5f - area.width() * 0.5f +
|
||||
((float)width * 0.5f - ((float)screenSize.width() * 0.5 * scaleFactor)) / leftWindows;
|
||||
float factor = 1.0;
|
||||
if (specialHandlingForward)
|
||||
|
@ -768,12 +768,12 @@ void CoverSwitchEffect::paintWindows(const EffectWindowList& windows, bool left,
|
|||
data.setRotationAxis(Qt::YAxis);
|
||||
data.setRotationAngle(angle * rotateFactor);
|
||||
if (left) {
|
||||
data.translate(-xTranslate - additionalWindow->geometry().x());
|
||||
data.translate(-xTranslate - additionalWindow->frameGeometry().x());
|
||||
}
|
||||
else {
|
||||
data.translate(xTranslate + area.width() -
|
||||
additionalWindow->geometry().x() - additionalWindow->geometry().width());
|
||||
data.setRotationOrigin(QVector3D(additionalWindow->geometry().width(), 0.0, 0.0));
|
||||
additionalWindow->frameGeometry().x() - additionalWindow->frameGeometry().width());
|
||||
data.setRotationOrigin(QVector3D(additionalWindow->frameGeometry().width(), 0.0, 0.0));
|
||||
}
|
||||
data.multiplyOpacity((timeLine.value() - 0.5) * 2.0);
|
||||
paintWindowCover(additionalWindow, reflectedWindows, data);
|
||||
|
@ -792,15 +792,15 @@ void CoverSwitchEffect::paintWindows(const EffectWindowList& windows, bool left,
|
|||
data.setRotationAxis(Qt::YAxis);
|
||||
data.setRotationAngle(angle);
|
||||
if (left)
|
||||
data.translate(-xTranslate + xTranslate * i / windowCount - window->geometry().x());
|
||||
data.translate(-xTranslate + xTranslate * i / windowCount - window->frameGeometry().x());
|
||||
else
|
||||
data.translate(xTranslate + width - xTranslate * i / windowCount - window->geometry().x() - window->geometry().width());
|
||||
data.translate(xTranslate + width - xTranslate * i / windowCount - window->frameGeometry().x() - window->frameGeometry().width());
|
||||
if (animation) {
|
||||
if (direction == Right) {
|
||||
if ((i == windowCount - 1) && left) {
|
||||
// right most window on left side -> move to front
|
||||
// have to move one window distance plus half the difference between the window and the desktop size
|
||||
data.translate((xTranslate / windowCount + (width - window->geometry().width()) * 0.5f) * timeLine.value());
|
||||
data.translate((xTranslate / windowCount + (width - window->frameGeometry().width()) * 0.5f) * timeLine.value());
|
||||
data.setRotationAngle(angle - angle * timeLine.value());
|
||||
}
|
||||
// right most window does not have to be moved
|
||||
|
@ -812,7 +812,7 @@ void CoverSwitchEffect::paintWindows(const EffectWindowList& windows, bool left,
|
|||
} else {
|
||||
if ((i == windowCount - 1) && !left) {
|
||||
// left most window on right side -> move to front
|
||||
data.translate(- (xTranslate / windowCount + (width - window->geometry().width()) * 0.5f) * timeLine.value());
|
||||
data.translate(- (xTranslate / windowCount + (width - window->frameGeometry().width()) * 0.5f) * timeLine.value());
|
||||
data.setRotationAngle(angle - angle * timeLine.value());
|
||||
}
|
||||
// left most window does not have to be moved
|
||||
|
@ -824,7 +824,7 @@ void CoverSwitchEffect::paintWindows(const EffectWindowList& windows, bool left,
|
|||
}
|
||||
}
|
||||
if (!left)
|
||||
data.setRotationOrigin(QVector3D(window->geometry().width(), 0.0, 0.0));
|
||||
data.setRotationOrigin(QVector3D(window->frameGeometry().width(), 0.0, 0.0));
|
||||
data.setRotationAngle(data.rotationAngle() * rotateFactor);
|
||||
// make window most to edge transparent if animation
|
||||
if (animation && i == 0 && ((direction == Left && left) || (direction == Right && !left))) {
|
||||
|
|
|
@ -1261,7 +1261,7 @@ void CubeEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPa
|
|||
continue;
|
||||
paint = paint.subtracted(QRegion(effects->clientArea(ScreenArea, i, painting_desktop)));
|
||||
}
|
||||
paint = paint.subtracted(QRegion(w->geometry()));
|
||||
paint = paint.subtracted(QRegion(w->frameGeometry()));
|
||||
// in case of free area in multiscreen setup fill it with cap color
|
||||
if (!paint.isEmpty()) {
|
||||
glEnable(GL_BLEND);
|
||||
|
|
|
@ -328,7 +328,7 @@ void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, W
|
|||
for (int screen = 0; screen < effects->numScreens(); screen++) {
|
||||
QRect screenGeom = effects->clientArea(ScreenArea, screen, 0);
|
||||
|
||||
QRectF transformedGeo = w->geometry();
|
||||
QRectF transformedGeo = w->frameGeometry();
|
||||
// Display all quads on the same screen on the same pass
|
||||
WindowQuadList screenQuads;
|
||||
bool quadsAdded = false;
|
||||
|
@ -363,8 +363,8 @@ void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, W
|
|||
|
||||
QPointF newPos = scalePos(transformedGeo.topLeft().toPoint(), paintingDesktop, screen);
|
||||
double progress = timeline.currentValue();
|
||||
d.setXScale(interpolate(1, xScale * scale[screen] * (float)transformedGeo.width() / (float)w->geometry().width(), progress));
|
||||
d.setYScale(interpolate(1, yScale * scale[screen] * (float)transformedGeo.height() / (float)w->geometry().height(), progress));
|
||||
d.setXScale(interpolate(1, xScale * scale[screen] * (float)transformedGeo.width() / (float)w->frameGeometry().width(), progress));
|
||||
d.setYScale(interpolate(1, yScale * scale[screen] * (float)transformedGeo.height() / (float)w->frameGeometry().height(), progress));
|
||||
d += QPoint(qRound(newPos.x() - w->x()), qRound(newPos.y() - w->y()));
|
||||
|
||||
if (isUsingPresentWindows() && (w->isDock() || w->isSkipSwitcher())) {
|
||||
|
@ -889,12 +889,12 @@ EffectWindow* DesktopGridEffect::windowAt(QPoint pos) const
|
|||
if (w)
|
||||
return w;
|
||||
foreach (EffectWindow * w, windows) {
|
||||
if (w->isOnDesktop(desktop) && w->isDesktop() && w->geometry().contains(pos))
|
||||
if (w->isOnDesktop(desktop) && w->isDesktop() && w->frameGeometry().contains(pos))
|
||||
return w;
|
||||
}
|
||||
} else {
|
||||
foreach (EffectWindow * w, windows) {
|
||||
if (w->isOnDesktop(desktop) && w->isOnCurrentActivity() && !w->isMinimized() && w->geometry().contains(pos))
|
||||
if (w->isOnDesktop(desktop) && w->isOnCurrentActivity() && !w->isMinimized() && w->frameGeometry().contains(pos))
|
||||
return w;
|
||||
}
|
||||
}
|
||||
|
@ -1054,7 +1054,7 @@ void DesktopGridEffect::setActive(bool active)
|
|||
QList<WindowMotionManager>::iterator it;
|
||||
for (it = m_managers.begin(); it != m_managers.end(); ++it) {
|
||||
foreach (EffectWindow * w, (*it).managedWindows()) {
|
||||
(*it).moveWindow(w, w->geometry());
|
||||
(*it).moveWindow(w, w->frameGeometry());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ void GlideEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowP
|
|||
// [move to the origin] -> [rotate] -> [translate] ->
|
||||
// -> [perspective projection] -> [reverse "move to the origin"]
|
||||
const QMatrix4x4 oldProjMatrix = data.screenProjectionMatrix();
|
||||
const QRectF windowGeo = w->geometry();
|
||||
const QRectF windowGeo = w->frameGeometry();
|
||||
const QVector3D invOffset = oldProjMatrix.map(QVector3D(windowGeo.center()));
|
||||
QMatrix4x4 invOffsetMatrix;
|
||||
invOffsetMatrix.translate(invOffset.x(), invOffset.y());
|
||||
|
|
|
@ -84,7 +84,7 @@ void MagicLampEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Win
|
|||
// 0 = not minimized, 1 = fully minimized
|
||||
const qreal progress = (*animationIt).timeLine.value();
|
||||
|
||||
QRect geo = w->geometry();
|
||||
QRect geo = w->frameGeometry();
|
||||
QRect icon = w->iconGeometry();
|
||||
IconPosition position = Top;
|
||||
// If there's no icon geometry, minimize to the center of the screen
|
||||
|
@ -133,7 +133,7 @@ void MagicLampEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Win
|
|||
continue;
|
||||
// we have to use intersects as there seems to be a Plasma bug
|
||||
// the published icon geometry might be bigger than the panel
|
||||
if (window->geometry().intersects(icon)) {
|
||||
if (window->frameGeometry().intersects(icon)) {
|
||||
panel = window;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1113,14 +1113,14 @@ void PresentWindowsEffect::calculateWindowTransformationsClosest(EffectWindowLis
|
|||
while (!tmpList.isEmpty()) {
|
||||
EffectWindow *w = tmpList.first();
|
||||
int slotCandidate = -1, slotCandidateDistance = INT_MAX;
|
||||
QPoint pos = w->geometry().center();
|
||||
QPoint pos = w->frameGeometry().center();
|
||||
|
||||
for (int i = 0; i < columns*rows; ++i) { // all slots
|
||||
const int dist = distance(pos, slotCenters[i]);
|
||||
if (dist < slotCandidateDistance) { // window is interested in this slot
|
||||
EffectWindow *occupier = takenSlots[i];
|
||||
Q_ASSERT(occupier != w);
|
||||
if (!occupier || dist < distance((otherPos = occupier->geometry().center()), slotCenters[i])) {
|
||||
if (!occupier || dist < distance((otherPos = occupier->frameGeometry().center()), slotCenters[i])) {
|
||||
// either nobody lives here, or we're better - takeover the slot if it's our best
|
||||
slotCandidate = i;
|
||||
slotCandidateDistance = dist;
|
||||
|
@ -1313,13 +1313,13 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
|
|||
// just have a single window on a Xinerama screen or have two windows that do not touch.
|
||||
// TODO: Work out why this happens, is most likely a bug in the manager.
|
||||
foreach (EffectWindow * w, windowlist)
|
||||
if (motionManager.transformedGeometry(w) == w->geometry())
|
||||
if (motionManager.transformedGeometry(w) == w->frameGeometry())
|
||||
motionManager.reset(w);
|
||||
|
||||
if (windowlist.count() == 1) {
|
||||
// Just move the window to its original location to save time
|
||||
if (effects->clientArea(FullScreenArea, windowlist[0]).contains(windowlist[0]->geometry())) {
|
||||
motionManager.moveWindow(windowlist[0], windowlist[0]->geometry());
|
||||
if (effects->clientArea(FullScreenArea, windowlist[0]).contains(windowlist[0]->frameGeometry())) {
|
||||
motionManager.moveWindow(windowlist[0], windowlist[0]->frameGeometry());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1336,8 +1336,8 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
|
|||
QHash<EffectWindow*, QRect> targets;
|
||||
QHash<EffectWindow*, int> directions;
|
||||
foreach (EffectWindow * w, windowlist) {
|
||||
bounds = bounds.united(w->geometry());
|
||||
targets[w] = w->geometry();
|
||||
bounds = bounds.united(w->frameGeometry());
|
||||
targets[w] = w->frameGeometry();
|
||||
// Reuse the unused "slot" as a preferred direction attribute. This is used when the window
|
||||
// is on the edge of the screen to try to use as much screen real estate as possible.
|
||||
directions[w] = direction;
|
||||
|
@ -1683,7 +1683,7 @@ void PresentWindowsEffect::setActive(bool active)
|
|||
|
||||
// Move all windows back to their original position
|
||||
foreach (EffectWindow * w, m_motionManager.managedWindows())
|
||||
m_motionManager.moveWindow(w, w->geometry());
|
||||
m_motionManager.moveWindow(w, w->frameGeometry());
|
||||
if (m_filterFrame) {
|
||||
m_filterFrame->free();
|
||||
}
|
||||
|
|
|
@ -138,8 +138,8 @@ void ResizeEffect::slotWindowStartUserMovedResized(EffectWindow *w)
|
|||
if (w->isUserResize() && !w->isUserMove()) {
|
||||
m_active = true;
|
||||
m_resizeWindow = w;
|
||||
m_originalGeometry = w->geometry();
|
||||
m_currentGeometry = w->geometry();
|
||||
m_originalGeometry = w->frameGeometry();
|
||||
m_currentGeometry = w->frameGeometry();
|
||||
w->addRepaintFull();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -536,7 +536,7 @@ void ScreenShotDBusInterface1::screenshotWindowUnderCursor(int mask)
|
|||
if (hoveredWindow->isOnCurrentDesktop()
|
||||
&& !hoveredWindow->isMinimized()
|
||||
&& !hoveredWindow->isDeleted()
|
||||
&& hoveredWindow->geometry().contains(cursor)) {
|
||||
&& hoveredWindow->frameGeometry().contains(cursor)) {
|
||||
break;
|
||||
}
|
||||
hoveredWindow = nullptr;
|
||||
|
|
|
@ -89,7 +89,7 @@ void SheetEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowP
|
|||
// [move to the origin] -> [scale] -> [rotate] -> [translate] ->
|
||||
// -> [perspective projection] -> [reverse "move to the origin"]
|
||||
const QMatrix4x4 oldProjMatrix = data.screenProjectionMatrix();
|
||||
const QRectF windowGeo = w->geometry();
|
||||
const QRectF windowGeo = w->frameGeometry();
|
||||
const QVector3D invOffset = oldProjMatrix.map(QVector3D(windowGeo.center()));
|
||||
QMatrix4x4 invOffsetMatrix;
|
||||
invOffsetMatrix.translate(invOffset.x(), invOffset.y());
|
||||
|
|
|
@ -64,9 +64,9 @@ void SlideBackEffect::windowRaised(EffectWindow *w)
|
|||
} else {
|
||||
if (isWindowUsable(tmp) && tmp->isOnCurrentDesktop() && w->isOnCurrentDesktop()) {
|
||||
// Do we have to move it?
|
||||
if (intersects(w, tmp->geometry())) {
|
||||
if (intersects(w, tmp->frameGeometry())) {
|
||||
QRect slideRect;
|
||||
slideRect = getSlideDestination(getModalGroupGeometry(w), tmp->geometry());
|
||||
slideRect = getSlideDestination(getModalGroupGeometry(w), tmp->frameGeometry());
|
||||
effects->setElevatedWindow(tmp, true);
|
||||
elevatedList.append(tmp);
|
||||
motionManager.manage(tmp);
|
||||
|
@ -76,7 +76,7 @@ void SlideBackEffect::windowRaised(EffectWindow *w)
|
|||
} else {
|
||||
//Does it intersect with a moved (elevated) window and do we have to elevate it too?
|
||||
foreach (EffectWindow * elevatedWindow, elevatedList) {
|
||||
if (tmp->geometry().intersects(elevatedWindow->geometry())) {
|
||||
if (tmp->frameGeometry().intersects(elevatedWindow->frameGeometry())) {
|
||||
effects->setElevatedWindow(tmp, true);
|
||||
elevatedList.append(tmp);
|
||||
break;
|
||||
|
@ -192,11 +192,11 @@ void SlideBackEffect::postPaintWindow(EffectWindow* w)
|
|||
if (coveringWindows.contains(w)) {
|
||||
EffectWindowList tmpList;
|
||||
foreach (EffectWindow * tmp, elevatedList) {
|
||||
QRect elevatedGeometry = tmp->geometry();
|
||||
QRect elevatedGeometry = tmp->frameGeometry();
|
||||
if (motionManager.isManaging(tmp)) {
|
||||
elevatedGeometry = motionManager.transformedGeometry(tmp).toAlignedRect();
|
||||
}
|
||||
if (m_upmostWindow && !tmp->isDock() && !tmp->keepAbove() && m_upmostWindow->geometry().intersects(elevatedGeometry)) {
|
||||
if (m_upmostWindow && !tmp->isDock() && !tmp->keepAbove() && m_upmostWindow->frameGeometry().intersects(elevatedGeometry)) {
|
||||
QRect newDestination;
|
||||
newDestination = getSlideDestination(getModalGroupGeometry(m_upmostWindow), elevatedGeometry);
|
||||
if (!motionManager.isManaging(tmp)) {
|
||||
|
@ -208,7 +208,7 @@ void SlideBackEffect::postPaintWindow(EffectWindow* w)
|
|||
if (!tmp->isDock()) {
|
||||
bool keepElevated = false;
|
||||
foreach (EffectWindow * elevatedWindow, tmpList) {
|
||||
if (tmp->geometry().intersects(elevatedWindow->geometry())) {
|
||||
if (tmp->frameGeometry().intersects(elevatedWindow->frameGeometry())) {
|
||||
keepElevated = true;
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ void SlideBackEffect::postPaintWindow(EffectWindow* w)
|
|||
}
|
||||
} else {
|
||||
// Move the window back where it belongs
|
||||
motionManager.moveWindow(w, w->geometry());
|
||||
motionManager.moveWindow(w, w->frameGeometry());
|
||||
destinationList.remove(w);
|
||||
}
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ EffectWindowList SlideBackEffect::usableWindows(const EffectWindowList & allWind
|
|||
{
|
||||
EffectWindowList retList;
|
||||
auto isWindowVisible = [] (const EffectWindow *window) {
|
||||
return window && effects->virtualScreenGeometry().intersects(window->geometry());
|
||||
return window && effects->virtualScreenGeometry().intersects(window->frameGeometry());
|
||||
};
|
||||
foreach (EffectWindow * tmp, allWindows) {
|
||||
if (isWindowUsable(tmp) && isWindowVisible(tmp)) {
|
||||
|
@ -322,7 +322,7 @@ EffectWindowList SlideBackEffect::usableWindows(const EffectWindowList & allWind
|
|||
|
||||
QRect SlideBackEffect::getModalGroupGeometry(EffectWindow *w)
|
||||
{
|
||||
QRect modalGroupGeometry = w->geometry();
|
||||
QRect modalGroupGeometry = w->frameGeometry();
|
||||
if (w->isModal()) {
|
||||
foreach (EffectWindow * modalWindow, w->mainWindows()) {
|
||||
modalGroupGeometry = modalGroupGeometry.united(getModalGroupGeometry(modalWindow));
|
||||
|
|
|
@ -293,7 +293,7 @@ void SlidingPopupsEffect::slotPropertyNotify(EffectWindow *w, long atom)
|
|||
void SlidingPopupsEffect::setupAnimData(EffectWindow *w)
|
||||
{
|
||||
const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), effects->currentDesktop());
|
||||
const QRect windowGeo = w->geometry();
|
||||
const QRect windowGeo = w->frameGeometry();
|
||||
AnimationData &animData = m_animationsData[w];
|
||||
|
||||
if (animData.offset == -1) {
|
||||
|
|
|
@ -281,7 +281,7 @@ void SnapHelperEffect::slotWindowStartUserMovedResized(EffectWindow *w)
|
|||
}
|
||||
|
||||
m_window = w;
|
||||
m_geometry = w->geometry();
|
||||
m_geometry = w->frameGeometry();
|
||||
|
||||
m_animation.active = true;
|
||||
m_animation.timeLine.setDirection(TimeLine::Forward);
|
||||
|
@ -300,7 +300,7 @@ void SnapHelperEffect::slotWindowFinishUserMovedResized(EffectWindow *w)
|
|||
}
|
||||
|
||||
m_window = nullptr;
|
||||
m_geometry = w->geometry();
|
||||
m_geometry = w->frameGeometry();
|
||||
|
||||
m_animation.active = true;
|
||||
m_animation.timeLine.setDirection(TimeLine::Backward);
|
||||
|
@ -318,7 +318,7 @@ void SnapHelperEffect::slotWindowFrameGeometryChanged(EffectWindow *w, const QRe
|
|||
return;
|
||||
}
|
||||
|
||||
m_geometry = w->geometry();
|
||||
m_geometry = w->frameGeometry();
|
||||
|
||||
effects->addRepaint(computeDirtyRegion(old));
|
||||
}
|
||||
|
|
|
@ -109,9 +109,9 @@ void WindowGeometry::slotWindowStartUserMovedResized(EffectWindow *w)
|
|||
createFrames();
|
||||
iAmActive = true;
|
||||
myResizeWindow = w;
|
||||
myOriginalGeometry = w->geometry();
|
||||
myCurrentGeometry = w->geometry();
|
||||
slotWindowStepUserMovedResized(w, w->geometry());
|
||||
myOriginalGeometry = w->frameGeometry();
|
||||
myCurrentGeometry = w->frameGeometry();
|
||||
slotWindowStepUserMovedResized(w, w->frameGeometry());
|
||||
}
|
||||
|
||||
void WindowGeometry::slotWindowFinishUserMovedResized(EffectWindow *w)
|
||||
|
@ -159,8 +159,8 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect
|
|||
QRect expandedGeometry = w->expandedGeometry();
|
||||
expandedGeometry = geometry.adjusted(expandedGeometry.x() - w->x(),
|
||||
expandedGeometry.y() - w->y(),
|
||||
expandedGeometry.right() - w->geometry().right(),
|
||||
expandedGeometry.bottom() - w->geometry().bottom());
|
||||
expandedGeometry.right() - w->frameGeometry().right(),
|
||||
expandedGeometry.bottom() - w->frameGeometry().bottom());
|
||||
|
||||
// sufficient for moves, resizes calculated otherwise
|
||||
int dx = r.x() - r2.x();
|
||||
|
|
|
@ -270,10 +270,10 @@ void WobblyWindowsEffect::paintWindow(EffectWindow* w, int mask, QRegion region,
|
|||
{
|
||||
if (!(mask & PAINT_SCREEN_TRANSFORMED) && windows.contains(w)) {
|
||||
WindowWobblyInfos& wwi = windows[w];
|
||||
int tx = w->geometry().x();
|
||||
int ty = w->geometry().y();
|
||||
int width = w->geometry().width();
|
||||
int height = w->geometry().height();
|
||||
int tx = w->frameGeometry().x();
|
||||
int ty = w->frameGeometry().y();
|
||||
int width = w->frameGeometry().width();
|
||||
int height = w->frameGeometry().height();
|
||||
double left = 0.0;
|
||||
double top = 0.0;
|
||||
double right = w->width();
|
||||
|
@ -330,7 +330,7 @@ void WobblyWindowsEffect::slotWindowStepUserMovedResized(EffectWindow *w, const
|
|||
Q_UNUSED(geometry)
|
||||
if (windows.contains(w)) {
|
||||
WindowWobblyInfos& wwi = windows[w];
|
||||
QRect rect = w->geometry();
|
||||
const QRect rect = w->frameGeometry();
|
||||
if (rect.y() != wwi.resize_original_rect.y()) wwi.can_wobble_top = true;
|
||||
if (rect.x() != wwi.resize_original_rect.x()) wwi.can_wobble_left = true;
|
||||
if (rect.right() != wwi.resize_original_rect.right()) wwi.can_wobble_right = true;
|
||||
|
@ -343,7 +343,7 @@ void WobblyWindowsEffect::slotWindowFinishUserMovedResized(EffectWindow *w)
|
|||
if (windows.contains(w)) {
|
||||
WindowWobblyInfos& wwi = windows[w];
|
||||
wwi.status = Free;
|
||||
QRect rect = w->geometry();
|
||||
const QRect rect = w->frameGeometry();
|
||||
if (rect.y() != wwi.resize_original_rect.y()) wwi.can_wobble_top = true;
|
||||
if (rect.x() != wwi.resize_original_rect.x()) wwi.can_wobble_left = true;
|
||||
if (rect.right() != wwi.resize_original_rect.right()) wwi.can_wobble_right = true;
|
||||
|
@ -365,7 +365,7 @@ void WobblyWindowsEffect::slotWindowMaximizeStateChanged(EffectWindow *w, bool h
|
|||
|
||||
if (windows.contains(w)) {
|
||||
WindowWobblyInfos& wwi = windows[w];
|
||||
QRect rect = w->geometry();
|
||||
const QRect rect = w->frameGeometry();
|
||||
if (rect.y() != wwi.resize_original_rect.y()) wwi.can_wobble_top = true;
|
||||
if (rect.x() != wwi.resize_original_rect.x()) wwi.can_wobble_left = true;
|
||||
if (rect.right() != wwi.resize_original_rect.right()) wwi.can_wobble_right = true;
|
||||
|
@ -377,13 +377,13 @@ void WobblyWindowsEffect::startMovedResized(EffectWindow* w)
|
|||
{
|
||||
if (!windows.contains(w)) {
|
||||
WindowWobblyInfos new_wwi;
|
||||
initWobblyInfo(new_wwi, w->geometry());
|
||||
initWobblyInfo(new_wwi, w->frameGeometry());
|
||||
windows[w] = new_wwi;
|
||||
}
|
||||
|
||||
WindowWobblyInfos& wwi = windows[w];
|
||||
wwi.status = Moving;
|
||||
const QRectF& rect = w->geometry();
|
||||
const QRectF& rect = w->frameGeometry();
|
||||
|
||||
qreal x_increment = rect.width() / (wwi.width - 1.0);
|
||||
qreal y_increment = rect.height() / (wwi.height - 1.0);
|
||||
|
@ -408,7 +408,7 @@ void WobblyWindowsEffect::startMovedResized(EffectWindow* w)
|
|||
// on a resize, do not allow any edges to wobble until it has been moved from
|
||||
// its original location
|
||||
wwi.can_wobble_top = wwi.can_wobble_left = wwi.can_wobble_right = wwi.can_wobble_bottom = false;
|
||||
wwi.resize_original_rect = w->geometry();
|
||||
wwi.resize_original_rect = w->frameGeometry();
|
||||
} else {
|
||||
wwi.can_wobble_top = wwi.can_wobble_left = wwi.can_wobble_right = wwi.can_wobble_bottom = true;
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ void WobblyWindowsEffect::startMovedResized(EffectWindow* w)
|
|||
|
||||
void WobblyWindowsEffect::stepMovedResized(EffectWindow* w)
|
||||
{
|
||||
QRect new_geometry = w->geometry();
|
||||
QRect new_geometry = w->frameGeometry();
|
||||
if (!windows.contains(w)) {
|
||||
WindowWobblyInfos new_wwi;
|
||||
initWobblyInfo(new_wwi, new_geometry);
|
||||
|
@ -592,7 +592,7 @@ static inline void computeVectorBounds(WobblyWindowsEffect::Pair& vec, WobblyWin
|
|||
|
||||
bool WobblyWindowsEffect::updateWindowWobblyDatas(EffectWindow* w, qreal time)
|
||||
{
|
||||
QRectF rect = w->geometry();
|
||||
QRectF rect = w->frameGeometry();
|
||||
WindowWobblyInfos& wwi = windows[w];
|
||||
|
||||
qreal x_length = rect.width() / (wwi.width - 1.0);
|
||||
|
|
|
@ -115,7 +115,7 @@ void AnimationEffect::validate(Attribute a, uint &meta, FPx2 *from, FPx2 *to, co
|
|||
|
||||
} else if (a == Position) {
|
||||
QRect area = effects->clientArea(ScreenArea , w);
|
||||
QPoint pt = w->geometry().bottomRight(); // cannot be < 0 ;-)
|
||||
QPoint pt = w->frameGeometry().bottomRight(); // cannot be < 0 ;-)
|
||||
if (from) {
|
||||
if (from->isValid()) {
|
||||
RELATIVE_XY(Source);
|
||||
|
@ -560,7 +560,7 @@ void AnimationEffect::paintWindow( EffectWindow* w, int mask, QRegion region, Wi
|
|||
case Saturation:
|
||||
data.multiplySaturation(interpolated(*anim)); break;
|
||||
case Scale: {
|
||||
const QSize sz = w->geometry().size();
|
||||
const QSize sz = w->frameGeometry().size();
|
||||
float f1(1.0), f2(0.0);
|
||||
if (anim->from[0] >= 0.0 && anim->to[0] >= 0.0) { // scale x
|
||||
f1 = interpolated(*anim, 0);
|
||||
|
@ -588,7 +588,7 @@ void AnimationEffect::paintWindow( EffectWindow* w, int mask, QRegion region, Wi
|
|||
break;
|
||||
case Size: {
|
||||
FPx2 dest = anim->from + progress(*anim) * (anim->to - anim->from);
|
||||
const QSize sz = w->geometry().size();
|
||||
const QSize sz = w->frameGeometry().size();
|
||||
float f;
|
||||
if (anim->from[0] >= 0.0 && anim->to[0] >= 0.0) { // resize x
|
||||
f = dest[0]/sz.width();
|
||||
|
@ -603,7 +603,7 @@ void AnimationEffect::paintWindow( EffectWindow* w, int mask, QRegion region, Wi
|
|||
break;
|
||||
}
|
||||
case Position: {
|
||||
const QRect geo = w->geometry();
|
||||
const QRect geo = w->frameGeometry();
|
||||
const float prgrs = progress(*anim);
|
||||
if ( anim->from[0] >= 0.0 && anim->to[0] >= 0.0 ) {
|
||||
float dest = interpolated(*anim, 0);
|
||||
|
@ -866,7 +866,7 @@ void AnimationEffect::updateLayerRepaints()
|
|||
case Translation:
|
||||
case Position: {
|
||||
createRegion = true;
|
||||
QRect r(entry.key()->geometry());
|
||||
QRect r(entry.key()->frameGeometry());
|
||||
int x[2] = {0,0};
|
||||
int y[2] = {0,0};
|
||||
if (anim->attribute == Translation) {
|
||||
|
@ -894,7 +894,7 @@ void AnimationEffect::updateLayerRepaints()
|
|||
case Size:
|
||||
case Scale: {
|
||||
createRegion = true;
|
||||
const QSize sz = entry.key()->geometry().size();
|
||||
const QSize sz = entry.key()->frameGeometry().size();
|
||||
float fx = qMax(fixOvershoot(anim->from[0], *anim, 1), fixOvershoot(anim->to[0], *anim, 2));
|
||||
// float fx = qMax(interpolated(*anim,0), anim->to[0]);
|
||||
if (fx >= 0.0) {
|
||||
|
|
|
@ -1632,10 +1632,10 @@ QRectF WindowMotionManager::transformedGeometry(EffectWindow *w) const
|
|||
{
|
||||
QHash<EffectWindow*, WindowMotion>::const_iterator it = m_managedWindows.constFind(w);
|
||||
if (it == m_managedWindows.end())
|
||||
return w->geometry();
|
||||
return w->frameGeometry();
|
||||
|
||||
const WindowMotion *motion = &it.value();
|
||||
QRectF geometry(w->geometry());
|
||||
QRectF geometry(w->frameGeometry());
|
||||
|
||||
// TODO: Take into account existing scale so that we can work with multiple managers (E.g. Present windows + grid)
|
||||
geometry.moveTo(motion->translation.value());
|
||||
|
@ -1659,10 +1659,10 @@ QRectF WindowMotionManager::targetGeometry(EffectWindow *w) const
|
|||
{
|
||||
QHash<EffectWindow*, WindowMotion>::const_iterator it = m_managedWindows.constFind(w);
|
||||
if (it == m_managedWindows.end())
|
||||
return w->geometry();
|
||||
return w->frameGeometry();
|
||||
|
||||
const WindowMotion *motion = &it.value();
|
||||
QRectF geometry(w->geometry());
|
||||
QRectF geometry(w->frameGeometry());
|
||||
|
||||
// TODO: Take into account existing scale so that we can work with multiple managers (E.g. Present windows + grid)
|
||||
geometry.moveTo(motion->translation.target());
|
||||
|
|
Loading…
Reference in a new issue