Remove Placement wrappers from Workspace

The two methods:
* place
* placeSmart
have only forwarded the call to the Placement object. Now that Placement
is a singleton there is no need to have them. Every user can call them
directly without going over Workspace.
icc-effect-5.14.5
Martin Gräßlin 2012-11-22 13:33:23 +01:00
parent 835648bc20
commit f689df14d5
4 changed files with 5 additions and 21 deletions

View File

@ -2195,7 +2195,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
if (geom_restore.width() == 0 || !clientArea.contains(geom_restore.center())) { if (geom_restore.width() == 0 || !clientArea.contains(geom_restore.center())) {
// needs placement // needs placement
plainResize(adjustedSize(QSize(width() * 2 / 3, clientArea.height()), SizemodeFixedH), geom_mode); plainResize(adjustedSize(QSize(width() * 2 / 3, clientArea.height()), SizemodeFixedH), geom_mode);
workspace()->placeSmart(this, clientArea); Placement::self()->placeSmart(this, clientArea);
} else { } else {
setGeometry(QRect(QPoint(geom_restore.x(), clientArea.top()), setGeometry(QRect(QPoint(geom_restore.x(), clientArea.top()),
adjustedSize(QSize(geom_restore.width(), clientArea.height()), SizemodeFixedH)), geom_mode); adjustedSize(QSize(geom_restore.width(), clientArea.height()), SizemodeFixedH)), geom_mode);
@ -2213,7 +2213,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
if (geom_restore.height() == 0 || !clientArea.contains(geom_restore.center())) { if (geom_restore.height() == 0 || !clientArea.contains(geom_restore.center())) {
// needs placement // needs placement
plainResize(adjustedSize(QSize(clientArea.width(), height() * 2 / 3), SizemodeFixedW), geom_mode); plainResize(adjustedSize(QSize(clientArea.width(), height() * 2 / 3), SizemodeFixedW), geom_mode);
workspace()->placeSmart(this, clientArea); Placement::self()->placeSmart(this, clientArea);
} else { } else {
setGeometry(QRect(QPoint(clientArea.left(), geom_restore.y()), setGeometry(QRect(QPoint(clientArea.left(), geom_restore.y()),
adjustedSize(QSize(clientArea.width(), geom_restore.height()), SizemodeFixedW)), geom_mode); adjustedSize(QSize(clientArea.width(), geom_restore.height()), SizemodeFixedW)), geom_mode);
@ -2244,7 +2244,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
if (geom_restore.height() > 0) if (geom_restore.height() > 0)
s.setHeight(geom_restore.height()); s.setHeight(geom_restore.height());
plainResize(adjustedSize(s)); plainResize(adjustedSize(s));
workspace()->placeSmart(this, clientArea); Placement::self()->placeSmart(this, clientArea);
restore = geometry(); restore = geometry();
if (geom_restore.width() > 0) if (geom_restore.width() > 0)
restore.moveLeft(geom_restore.x()); restore.moveLeft(geom_restore.x());
@ -2254,7 +2254,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
} }
setGeometry(restore, geom_mode); setGeometry(restore, geom_mode);
if (!clientArea.contains(geom_restore.center())) // Not restoring to the same screen if (!clientArea.contains(geom_restore.center())) // Not restoring to the same screen
workspace()->place(this, clientArea); Placement::self()->place(this, clientArea);
info->setState(0, NET::Max); info->setState(0, NET::Max);
break; break;
} }

View File

@ -367,7 +367,7 @@ bool Client::manage(Window w, bool isMapped)
} }
if (!placementDone) { if (!placementDone) {
// Placement needs to be after setting size // Placement needs to be after setting size
workspace()->place(this, area); Placement::self()->place(this, area);
placementDone = true; placementDone = true;
} }

View File

@ -885,19 +885,6 @@ int Workspace::packPositionDown(const Client* cl, int oldy, bool bottom_edge) co
return newy; return newy;
} }
/*!
Asks the internal positioning object to place a client
*/
void Workspace::place(Client* c, QRect& area)
{
initPositioning->place(c, area);
}
void Workspace::placeSmart(Client* c, const QRect& area)
{
initPositioning->placeSmart(c, area);
}
#endif #endif
} // namespace } // namespace

View File

@ -158,9 +158,6 @@ public:
*/ */
void setClientIsMoving(Client* c); void setClientIsMoving(Client* c);
void place(Client* c, QRect& area);
void placeSmart(Client* c, const QRect& area);
QPoint adjustClientPosition(Client* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0); QPoint adjustClientPosition(Client* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0);
QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode); QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode);
void raiseClient(Client* c, bool nogroup = false); void raiseClient(Client* c, bool nogroup = false);