Move (is|set)ElectricBorderMaximizing from Client to AbstractClient

This commit is contained in:
Martin Gräßlin 2015-10-12 10:12:07 +02:00
parent 226a099366
commit 53b87dbbd9
4 changed files with 8 additions and 12 deletions

View file

@ -519,6 +519,10 @@ protected:
QuickTileMode electricBorderMode() const {
return m_electricMode;
}
void setElectricBorderMaximizing(bool maximizing);
bool isElectricBorderMaximizing() const {
return m_electricMaximizing;
}
QRect electricBorderMaximizeGeometry(QPoint pos, int desktop);
private:
@ -555,6 +559,7 @@ private:
// electric border/quick tiling
QuickTileMode m_electricMode = QuickTileNone;
bool m_electricMaximizing = false;
};
inline void AbstractClient::move(const QPoint& p, ForceGeometry_t force)

View file

@ -125,7 +125,6 @@ Client::Client()
, pending_geometry_update(PendingGeometryNone)
, shade_geometry_change(false)
, sm_stacking_order(-1)
, electricMaximizing(false)
, m_electricMaximizingDelay(nullptr)
, activitiesDefined(false)
, needsSessionInteract(false)

View file

@ -293,8 +293,6 @@ public:
void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
void resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
void resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
void setElectricBorderMaximizing(bool maximizing);
bool isElectricBorderMaximizing() const;
QSize sizeForClientSize(const QSize&, Sizemode mode = SizemodeAny, bool noframe = false) const;
/** Set the quick tile mode ("snap") of this window.
@ -757,7 +755,6 @@ private:
friend struct ResetupRulesProcedure;
friend class GeometryUpdatesBlocker;
bool electricMaximizing;
QTimer* m_electricMaximizingDelay;
friend bool performTransiencyCheck();

View file

@ -2697,7 +2697,7 @@ void Client::finishMoveResize(bool cancel)
if (isElectricBorderMaximizing()) {
setQuickTileMode(electricBorderMode());
electricMaximizing = false;
setElectricBorderMaximizing(false);
} else if (!cancel) {
if (!(maximizeMode() & MaximizeHorizontal)) {
geom_restore.setX(geometry().x());
@ -3189,14 +3189,9 @@ void AbstractClient::setElectricBorderMode(QuickTileMode mode)
m_electricMode = mode;
}
bool Client::isElectricBorderMaximizing() const
void AbstractClient::setElectricBorderMaximizing(bool maximizing)
{
return electricMaximizing;
}
void Client::setElectricBorderMaximizing(bool maximizing)
{
electricMaximizing = maximizing;
m_electricMaximizing = maximizing;
if (maximizing)
outline()->show(electricBorderMaximizeGeometry(Cursor::pos(), desktop()));
else