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.
This commit is contained in:
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())) {
// needs placement
plainResize(adjustedSize(QSize(width() * 2 / 3, clientArea.height()), SizemodeFixedH), geom_mode);
workspace()->placeSmart(this, clientArea);
Placement::self()->placeSmart(this, clientArea);
} else {
setGeometry(QRect(QPoint(geom_restore.x(), clientArea.top()),
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())) {
// needs placement
plainResize(adjustedSize(QSize(clientArea.width(), height() * 2 / 3), SizemodeFixedW), geom_mode);
workspace()->placeSmart(this, clientArea);
Placement::self()->placeSmart(this, clientArea);
} else {
setGeometry(QRect(QPoint(clientArea.left(), geom_restore.y()),
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)
s.setHeight(geom_restore.height());
plainResize(adjustedSize(s));
workspace()->placeSmart(this, clientArea);
Placement::self()->placeSmart(this, clientArea);
restore = geometry();
if (geom_restore.width() > 0)
restore.moveLeft(geom_restore.x());
@ -2254,7 +2254,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
}
setGeometry(restore, geom_mode);
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);
break;
}

View file

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

View file

@ -885,19 +885,6 @@ int Workspace::packPositionDown(const Client* cl, int oldy, bool bottom_edge) co
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
} // namespace

View file

@ -158,9 +158,6 @@ public:
*/
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);
QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode);
void raiseClient(Client* c, bool nogroup = false);