Merge back implementation of Client::move and ShellClient::move
Implementation goes to AbstractClient, method is no longer virtual. The X11 specific code is moved to a new virtual protected doMove method implemented in Client.
This commit is contained in:
parent
c578720615
commit
8cdfb0e88f
6 changed files with 19 additions and 29 deletions
|
@ -1055,4 +1055,8 @@ void AbstractClient::updateTabGroupStates(TabGroup::States)
|
|||
{
|
||||
}
|
||||
|
||||
void AbstractClient::doMove(int, int)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -398,7 +398,7 @@ public:
|
|||
void updateLayer();
|
||||
|
||||
enum ForceGeometry_t { NormalGeometrySet, ForceGeometrySet };
|
||||
virtual void move(int x, int y, ForceGeometry_t force = NormalGeometrySet) = 0;
|
||||
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet);
|
||||
void move(const QPoint &p, ForceGeometry_t force = NormalGeometrySet);
|
||||
virtual void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) = 0;
|
||||
void resizeWithChecks(const QSize& s, ForceGeometry_t force = NormalGeometrySet);
|
||||
|
@ -565,6 +565,11 @@ protected:
|
|||
virtual int borderBottom() const;
|
||||
virtual void changeMaximize(bool horizontal, bool vertical, bool adjust) = 0;
|
||||
virtual void setGeometryRestore(const QRect &geo) = 0;
|
||||
/**
|
||||
* Called from move after updating the geometry. Can be reimplemented to perform specific tasks.
|
||||
* The base implementation does nothing.
|
||||
**/
|
||||
virtual void doMove(int x, int y);
|
||||
void blockGeometryUpdates(bool block);
|
||||
void blockGeometryUpdates();
|
||||
void unblockGeometryUpdates();
|
||||
|
|
3
client.h
3
client.h
|
@ -264,8 +264,6 @@ public:
|
|||
|
||||
using AbstractClient::setGeometry;
|
||||
void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
using AbstractClient::move;
|
||||
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
/// plainResize() simply resizes
|
||||
void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet);
|
||||
void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet);
|
||||
|
@ -488,6 +486,7 @@ protected:
|
|||
bool isActiveFullScreen() const override;
|
||||
void setGeometryRestore(const QRect &geo) override;
|
||||
void updateTabGroupStates(TabGroup::States states) override;
|
||||
void doMove(int x, int y) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void delayedSetShortcut();
|
||||
|
|
11
geometry.cpp
11
geometry.cpp
|
@ -2044,7 +2044,7 @@ void Client::plainResize(int w, int h, ForceGeometry_t force)
|
|||
/*!
|
||||
Reimplemented to inform the client about the new window position.
|
||||
*/
|
||||
void Client::move(int x, int y, ForceGeometry_t force)
|
||||
void AbstractClient::move(int x, int y, ForceGeometry_t force)
|
||||
{
|
||||
// resuming geometry updates is handled only in setGeometry()
|
||||
assert(pendingGeometryUpdate() == PendingGeometryNone || areGeometryUpdatesBlocked());
|
||||
|
@ -2064,8 +2064,7 @@ void Client::move(int x, int y, ForceGeometry_t force)
|
|||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
m_frame.move(x, y);
|
||||
sendSyntheticConfigureNotify();
|
||||
doMove(x, y);
|
||||
updateWindowRules(Rules::Position);
|
||||
screens()->setCurrent(this);
|
||||
workspace()->updateStackingOrder();
|
||||
|
@ -2082,6 +2081,12 @@ void Client::move(int x, int y, ForceGeometry_t force)
|
|||
emit geometryChanged();
|
||||
}
|
||||
|
||||
void Client::doMove(int x, int y)
|
||||
{
|
||||
m_frame.move(x, y);
|
||||
sendSyntheticConfigureNotify();
|
||||
}
|
||||
|
||||
void AbstractClient::blockGeometryUpdates(bool block)
|
||||
{
|
||||
if (block) {
|
||||
|
|
|
@ -592,27 +592,6 @@ void ShellClient::clientFullScreenChanged(bool fullScreen)
|
|||
}
|
||||
}
|
||||
|
||||
void ShellClient::move(int x, int y, ForceGeometry_t force)
|
||||
{
|
||||
QPoint p(x, y);
|
||||
if (force == NormalGeometrySet && geom.topLeft() == p) {
|
||||
return;
|
||||
}
|
||||
const QRect oldGeom = visibleRect();
|
||||
geom.moveTopLeft(p);
|
||||
updateWindowRules(Rules::Position);
|
||||
screens()->setCurrent(this);
|
||||
workspace()->updateStackingOrder();
|
||||
if (Compositor::isCreated()) {
|
||||
// TODO: is this really needed here?
|
||||
Compositor::self()->checkUnredirect();
|
||||
}
|
||||
|
||||
addLayerRepaint(oldGeom);
|
||||
addLayerRepaint(visibleRect());
|
||||
emit geometryChanged();
|
||||
}
|
||||
|
||||
void ShellClient::resizeWithChecks(int w, int h, ForceGeometry_t force)
|
||||
{
|
||||
Q_UNUSED(force)
|
||||
|
|
|
@ -88,8 +88,6 @@ public:
|
|||
bool userCanSetNoBorder() const override;
|
||||
bool wantsInput() const override;
|
||||
xcb_window_t window() const override;
|
||||
using AbstractClient::move;
|
||||
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
using AbstractClient::resizeWithChecks;
|
||||
void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
using AbstractClient::setGeometry;
|
||||
|
|
Loading…
Reference in a new issue