From 32863aac9b6907ed7d0eaa1a3d3a62e014d96706 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Wed, 24 Apr 2019 01:49:10 +0300 Subject: [PATCH] Use AbstractClient::Position instead of Client::Position Test Plan: Compiles. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D20778 --- geometry.cpp | 42 +++++++++++++++++++++--------------------- placement.cpp | 18 +++++++++--------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 16ba7100f0..879e8062a4 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -510,17 +510,17 @@ QPoint Workspace::adjustClientPosition(AbstractClient* c, QPoint pos, bool unres int padding[4] = { cp.x(), cs.width() - cp.x(), cp.y(), cs.height() - cp.y() }; // snap to titlebar / snap to window borders on inner screen edges - Client::Position titlePos = c->titlebarPosition(); - if (padding[0] && (titlePos == Client::PositionLeft || (c->maximizeMode() & MaximizeHorizontal) || + AbstractClient::Position titlePos = c->titlebarPosition(); + if (padding[0] && (titlePos == AbstractClient::PositionLeft || (c->maximizeMode() & MaximizeHorizontal) || screens()->intersecting(geo.translated(maxRect.x() - (padding[0] + geo.x()), 0)) > 1)) padding[0] = 0; - if (padding[1] && (titlePos == Client::PositionRight || (c->maximizeMode() & MaximizeHorizontal) || + if (padding[1] && (titlePos == AbstractClient::PositionRight || (c->maximizeMode() & MaximizeHorizontal) || screens()->intersecting(geo.translated(maxRect.right() + padding[1] - geo.right(), 0)) > 1)) padding[1] = 0; - if (padding[2] && (titlePos == Client::PositionTop || (c->maximizeMode() & MaximizeVertical) || + if (padding[2] && (titlePos == AbstractClient::PositionTop || (c->maximizeMode() & MaximizeVertical) || screens()->intersecting(geo.translated(0, maxRect.y() - (padding[2] + geo.y()))) > 1)) padding[2] = 0; - if (padding[3] && (titlePos == Client::PositionBottom || (c->maximizeMode() & MaximizeVertical) || + if (padding[3] && (titlePos == AbstractClient::PositionBottom || (c->maximizeMode() & MaximizeVertical) || screens()->intersecting(geo.translated(0, maxRect.bottom() + padding[3] - geo.bottom())) > 1)) padding[3] = 0; if ((sOWO ? (cx < xmin) : true) && (qAbs(xmin - cx) < snapX)) { @@ -702,31 +702,31 @@ QRect Workspace::adjustClientSize(AbstractClient* c, QRect moveResizeGeom, int m newrx = xmax; \ } switch(mode) { - case Client::PositionBottomRight: + case AbstractClient::PositionBottomRight: SNAP_BORDER_BOTTOM SNAP_BORDER_RIGHT break; - case Client::PositionRight: + case AbstractClient::PositionRight: SNAP_BORDER_RIGHT break; - case Client::PositionBottom: + case AbstractClient::PositionBottom: SNAP_BORDER_BOTTOM break; - case Client::PositionTopLeft: + case AbstractClient::PositionTopLeft: SNAP_BORDER_TOP SNAP_BORDER_LEFT break; - case Client::PositionLeft: + case AbstractClient::PositionLeft: SNAP_BORDER_LEFT break; - case Client::PositionTop: + case AbstractClient::PositionTop: SNAP_BORDER_TOP break; - case Client::PositionTopRight: + case AbstractClient::PositionTopRight: SNAP_BORDER_TOP SNAP_BORDER_RIGHT break; - case Client::PositionBottomLeft: + case AbstractClient::PositionBottomLeft: SNAP_BORDER_BOTTOM SNAP_BORDER_LEFT break; @@ -818,41 +818,41 @@ QRect Workspace::adjustClientSize(AbstractClient* c, QRect moveResizeGeom, int m } switch(mode) { - case Client::PositionBottomRight: + case AbstractClient::PositionBottomRight: SNAP_WINDOW_BOTTOM SNAP_WINDOW_RIGHT SNAP_WINDOW_C_BOTTOM SNAP_WINDOW_C_RIGHT break; - case Client::PositionRight: + case AbstractClient::PositionRight: SNAP_WINDOW_RIGHT SNAP_WINDOW_C_RIGHT break; - case Client::PositionBottom: + case AbstractClient::PositionBottom: SNAP_WINDOW_BOTTOM SNAP_WINDOW_C_BOTTOM break; - case Client::PositionTopLeft: + case AbstractClient::PositionTopLeft: SNAP_WINDOW_TOP SNAP_WINDOW_LEFT SNAP_WINDOW_C_TOP SNAP_WINDOW_C_LEFT break; - case Client::PositionLeft: + case AbstractClient::PositionLeft: SNAP_WINDOW_LEFT SNAP_WINDOW_C_LEFT break; - case Client::PositionTop: + case AbstractClient::PositionTop: SNAP_WINDOW_TOP SNAP_WINDOW_C_TOP break; - case Client::PositionTopRight: + case AbstractClient::PositionTopRight: SNAP_WINDOW_TOP SNAP_WINDOW_RIGHT SNAP_WINDOW_C_TOP SNAP_WINDOW_C_RIGHT break; - case Client::PositionBottomLeft: + case AbstractClient::PositionBottomLeft: SNAP_WINDOW_BOTTOM SNAP_WINDOW_LEFT SNAP_WINDOW_C_BOTTOM diff --git a/placement.cpp b/placement.cpp index b4a3a9eca2..e13b37181d 100644 --- a/placement.cpp +++ b/placement.cpp @@ -111,19 +111,19 @@ void Placement::place(AbstractClient* c, QRect& area, Policy policy, Policy next QPoint corner = geo.topLeft(); const QPoint cp = c->clientPos(); const QSize cs = geo.size() - c->clientSize(); - Client::Position titlePos = c->titlebarPosition(); + AbstractClient::Position titlePos = c->titlebarPosition(); const QRect fullRect = workspace()->clientArea(FullArea, c); if (!(c->maximizeMode() & MaximizeHorizontal)) { - if (titlePos != Client::PositionRight && geo.right() == fullRect.right()) + if (titlePos != AbstractClient::PositionRight && geo.right() == fullRect.right()) corner.rx() += cs.width() - cp.x(); - if (titlePos != Client::PositionLeft && geo.x() == fullRect.x()) + if (titlePos != AbstractClient::PositionLeft && geo.x() == fullRect.x()) corner.rx() -= cp.x(); } if (!(c->maximizeMode() & MaximizeVertical)) { - if (titlePos != Client::PositionBottom && geo.bottom() == fullRect.bottom()) + if (titlePos != AbstractClient::PositionBottom && geo.bottom() == fullRect.bottom()) corner.ry() += cs.height() - cp.y(); - if (titlePos != Client::PositionTop && geo.y() == fullRect.y()) + if (titlePos != AbstractClient::PositionTop && geo.y() == fullRect.y()) corner.ry() -= cp.y(); } c->move(corner); @@ -842,7 +842,7 @@ int Workspace::packPositionLeft(const AbstractClient* cl, int oldx, bool left_ed if (oldx <= newx) // try another Xinerama screen newx = clientArea(MaximizeArea, QPoint(cl->geometry().left() - 1, cl->geometry().center().y()), cl->desktop()).left(); - if (cl->titlebarPosition() != Client::PositionLeft) { + if (cl->titlebarPosition() != AbstractClient::PositionLeft) { QRect geo = cl->geometry(); int rgt = newx - cl->clientPos().x(); geo.moveRight(rgt); @@ -870,7 +870,7 @@ int Workspace::packPositionRight(const AbstractClient* cl, int oldx, bool right_ if (oldx >= newx) // try another Xinerama screen newx = clientArea(MaximizeArea, QPoint(cl->geometry().right() + 1, cl->geometry().center().y()), cl->desktop()).right(); - if (cl->titlebarPosition() != Client::PositionRight) { + if (cl->titlebarPosition() != AbstractClient::PositionRight) { QRect geo = cl->geometry(); int rgt = newx + cl->width() - (cl->clientSize().width() + cl->clientPos().x()); geo.moveRight(rgt); @@ -898,7 +898,7 @@ int Workspace::packPositionUp(const AbstractClient* cl, int oldy, bool top_edge) if (oldy <= newy) // try another Xinerama screen newy = clientArea(MaximizeArea, QPoint(cl->geometry().center().x(), cl->geometry().top() - 1), cl->desktop()).top(); - if (cl->titlebarPosition() != Client::PositionTop) { + if (cl->titlebarPosition() != AbstractClient::PositionTop) { QRect geo = cl->geometry(); int top = newy - cl->clientPos().y(); geo.moveTop(top); @@ -926,7 +926,7 @@ int Workspace::packPositionDown(const AbstractClient* cl, int oldy, bool bottom_ if (oldy >= newy) // try another Xinerama screen newy = clientArea(MaximizeArea, QPoint(cl->geometry().center().x(), cl->geometry().bottom() + 1), cl->desktop()).bottom(); - if (cl->titlebarPosition() != Client::PositionBottom) { + if (cl->titlebarPosition() != AbstractClient::PositionBottom) { QRect geo = cl->geometry(); int btm = newy + cl->height() - (cl->clientSize().height() + cl->clientPos().y()); geo.moveBottom(btm);