Commit 7e238609 authored by Martin Flöser's avatar Martin Flöser

Move performMoveResize to AbstractClient

As there is X11 specific code, this is moved into a virtual
doPerformMoveResize method.
parent 43e40719
......@@ -1133,4 +1133,8 @@ void AbstractClient::positionGeometryTip()
{
}
void AbstractClient::doPerformMoveResize()
{
}
}
......@@ -717,6 +717,14 @@ protected:
**/
virtual void leaveMoveResize();
virtual void positionGeometryTip();
void performMoveResize();
/**
* Called from performMoveResize() after actually performing the change of geometry.
* Implementing subclasses can perform windowing system specific handling here.
*
* Default implementation does nothing.
**/
virtual void doPerformMoveResize();
static bool haveResizeEffect() {
return s_haveResizeEffect;
......
......@@ -469,10 +469,10 @@ protected:
void updateTabGroupStates(TabGroup::States states) override;
void doMove(int x, int y) override;
bool doStartMoveResize() override;
void doPerformMoveResize() override;
private Q_SLOTS:
void delayedSetShortcut();
void performMoveResize();
//Signals for the scripting interface
//Signals make an excellent way for communication
......
......@@ -3156,7 +3156,7 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root)
if (isResize() && !haveResizeEffect()) {
if (!syncRequest.timeout) {
syncRequest.timeout = new QTimer(this);
connect(syncRequest.timeout, SIGNAL(timeout()), SLOT(performMoveResize()));
connect(syncRequest.timeout, &QTimer::timeout, this, &Client::performMoveResize);
syncRequest.timeout->setSingleShot(true);
}
if (syncRequest.counter != XCB_NONE) {
......@@ -3176,21 +3176,26 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root)
}
}
void Client::performMoveResize()
void AbstractClient::performMoveResize()
{
const QRect &moveResizeGeom = moveResizeGeometry();
if (isMove() || (isResize() && !haveResizeEffect())) {
setGeometry(moveResizeGeom);
}
if (syncRequest.counter == XCB_NONE) // client w/o XSYNC support. allow the next resize event
syncRequest.isPending = false; // NEVER do this for clients with a valid counter
// (leads to sync request races in some clients)
doPerformMoveResize();
if (isResize())
addRepaintFull();
positionGeometryTip();
emit clientStepUserMovedResized(this, moveResizeGeom);
}
void Client::doPerformMoveResize()
{
if (syncRequest.counter == XCB_NONE) // client w/o XSYNC support. allow the next resize event
syncRequest.isPending = false; // NEVER do this for clients with a valid counter
// (leads to sync request races in some clients)
}
void AbstractClient::setElectricBorderMode(QuickTileMode mode)
{
if (mode != QuickTileMaximize) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment