Commit abe12881 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Use more accurate name for Workspace::getMovingClient method

Summary:
The name of Workspace::getMovingClient() method implies that the
returned value is a client that is currently being moved around
by the user, but this is of course incorrect.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20663
parent 20288555
......@@ -1462,7 +1462,7 @@ void AbstractClient::updateCursor()
void AbstractClient::leaveMoveResize()
{
workspace()->setClientIsMoving(nullptr);
workspace()->setMoveResizeClient(nullptr);
setMoveResize(false);
if (ScreenEdges::self()->isDesktopSwitchingMovingClients())
ScreenEdges::self()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal);
......
......@@ -160,10 +160,10 @@ void WobblyWindowsShadeTest::testShadeMove()
QVERIFY(windowStartUserMovedResizedSpy.isValid());
// begin move
QVERIFY(workspace()->getMovingClient() == nullptr);
QVERIFY(workspace()->moveResizeClient() == nullptr);
QCOMPARE(client->isMove(), false);
workspace()->slotWindowMove();
QCOMPARE(workspace()->getMovingClient(), client);
QCOMPARE(workspace()->moveResizeClient(), client);
QCOMPARE(client->isMove(), true);
QCOMPARE(windowStartUserMovedResizedSpy.count(), 1);
......
......@@ -565,7 +565,7 @@ void LockScreenTest::testMoveWindow()
quint32 timestamp = 1;
workspace()->slotWindowMove();
QCOMPARE(workspace()->getMovingClient(), c);
QCOMPARE(workspace()->moveResizeClient(), c);
QVERIFY(c->isMove());
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
......@@ -579,14 +579,14 @@ void LockScreenTest::testMoveWindow()
// while locking our window should continue to be in move resize
LOCK
QCOMPARE(workspace()->getMovingClient(), c);
QCOMPARE(workspace()->moveResizeClient(), c);
QVERIFY(c->isMove());
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
UNLOCK
QCOMPARE(workspace()->getMovingClient(), c);
QCOMPARE(workspace()->moveResizeClient(), c);
QVERIFY(c->isMove());
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
......
......@@ -159,10 +159,10 @@ void MoveResizeWindowTest::testMove()
QVERIFY(windowFinishUserMovedResizedSpy.isValid());
// begin move
QVERIFY(workspace()->getMovingClient() == nullptr);
QVERIFY(workspace()->moveResizeClient() == nullptr);
QCOMPARE(c->isMove(), false);
workspace()->slotWindowMove();
QCOMPARE(workspace()->getMovingClient(), c);
QCOMPARE(workspace()->moveResizeClient(), c);
QCOMPARE(startMoveResizedSpy.count(), 1);
QCOMPARE(moveResizedChangedSpy.count(), 1);
QCOMPARE(windowStartUserMovedResizedSpy.count(), 1);
......@@ -200,7 +200,7 @@ void MoveResizeWindowTest::testMove()
QCOMPARE(windowFinishUserMovedResizedSpy.count(), 1);
QCOMPARE(c->geometry(), QRect(16, 32, 100, 50));
QCOMPARE(c->isMove(), false);
QVERIFY(workspace()->getMovingClient() == nullptr);
QVERIFY(workspace()->moveResizeClient() == nullptr);
surface.reset();
QVERIFY(Test::waitForWindowDestroyed(c));
}
......@@ -237,11 +237,11 @@ void MoveResizeWindowTest::testResize()
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
// begin resize
QVERIFY(workspace()->getMovingClient() == nullptr);
QVERIFY(workspace()->moveResizeClient() == nullptr);
QCOMPARE(c->isMove(), false);
QCOMPARE(c->isResize(), false);
workspace()->slotWindowResize();
QCOMPARE(workspace()->getMovingClient(), c);
QCOMPARE(workspace()->moveResizeClient(), c);
QCOMPARE(startMoveResizedSpy.count(), 1);
QCOMPARE(moveResizedChangedSpy.count(), 1);
QCOMPARE(c->isResize(), true);
......@@ -282,7 +282,7 @@ void MoveResizeWindowTest::testResize()
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1);
QCOMPARE(moveResizedChangedSpy.count(), 2);
QCOMPARE(c->isResize(), false);
QVERIFY(workspace()->getMovingClient() == nullptr);
QVERIFY(workspace()->moveResizeClient() == nullptr);
surface.reset();
QVERIFY(Test::waitForWindowDestroyed(c));
}
......@@ -656,7 +656,7 @@ void MoveResizeWindowTest::testNetMove()
QVERIFY(moveEndSpy.isValid());
QSignalSpy moveStepSpy(client, &Client::clientStepUserMovedResized);
QVERIFY(moveStepSpy.isValid());
QVERIFY(!workspace()->getMovingClient());
QVERIFY(!workspace()->moveResizeClient());
// use NETRootInfo to trigger a move request
NETRootInfo root(c.data(), NET::Properties());
......@@ -664,7 +664,7 @@ void MoveResizeWindowTest::testNetMove()
xcb_flush(c.data());
QVERIFY(moveStartSpy.wait());
QCOMPARE(workspace()->getMovingClient(), client);
QCOMPARE(workspace()->moveResizeClient(), client);
QVERIFY(client->isMove());
QCOMPARE(client->geometryRestore(), origGeo);
QCOMPARE(Cursor::pos(), origGeo.center());
......@@ -1010,12 +1010,12 @@ void MoveResizeWindowTest::testDestroyMoveClient()
QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), false);
workspace()->slotWindowMove();
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
QCOMPARE(workspace()->getMovingClient(), client);
QCOMPARE(workspace()->moveResizeClient(), client);
QCOMPARE(client->isMove(), true);
QCOMPARE(client->isResize(), false);
......@@ -1024,7 +1024,7 @@ void MoveResizeWindowTest::testDestroyMoveClient()
surface.reset();
QVERIFY(Test::waitForWindowDestroyed(client));
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0);
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
}
void MoveResizeWindowTest::testDestroyResizeClient()
......@@ -1047,12 +1047,12 @@ void MoveResizeWindowTest::testDestroyResizeClient()
QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), false);
workspace()->slotWindowResize();
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
QCOMPARE(workspace()->getMovingClient(), client);
QCOMPARE(workspace()->moveResizeClient(), client);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), true);
......@@ -1061,7 +1061,7 @@ void MoveResizeWindowTest::testDestroyResizeClient()
surface.reset();
QVERIFY(Test::waitForWindowDestroyed(client));
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0);
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
}
void MoveResizeWindowTest::testUnmapMoveClient()
......@@ -1084,12 +1084,12 @@ void MoveResizeWindowTest::testUnmapMoveClient()
QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), false);
workspace()->slotWindowMove();
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
QCOMPARE(workspace()->getMovingClient(), client);
QCOMPARE(workspace()->moveResizeClient(), client);
QCOMPARE(client->isMove(), true);
QCOMPARE(client->isResize(), false);
......@@ -1100,7 +1100,7 @@ void MoveResizeWindowTest::testUnmapMoveClient()
surface->commit(Surface::CommitFlag::None);
QVERIFY(hiddenSpy.wait());
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0);
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), false);
......@@ -1130,12 +1130,12 @@ void MoveResizeWindowTest::testUnmapResizeClient()
QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), false);
workspace()->slotWindowResize();
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
QCOMPARE(workspace()->getMovingClient(), client);
QCOMPARE(workspace()->moveResizeClient(), client);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), true);
......@@ -1146,7 +1146,7 @@ void MoveResizeWindowTest::testUnmapResizeClient()
surface->commit(Surface::CommitFlag::None);
QVERIFY(hiddenSpy.wait());
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0);
QCOMPARE(workspace()->getMovingClient(), nullptr);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
QCOMPARE(client->isMove(), false);
QCOMPARE(client->isResize(), false);
......
......@@ -356,7 +356,7 @@ void QuickTilingTest::testQuickTilingKeyboardMove()
QVERIFY(quickTileChangedSpy.isValid());
workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp);
QCOMPARE(c, workspace()->getMovingClient());
QCOMPARE(c, workspace()->moveResizeClient());
QCOMPARE(Cursor::pos(), QPoint(49, 24));
QFETCH(QPoint, targetPos);
......@@ -382,7 +382,7 @@ void QuickTilingTest::testQuickTilingKeyboardMove()
kwinApp()->platform()->keyboardKeyPressed(KEY_ENTER, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_ENTER, timestamp++);
QCOMPARE(Cursor::pos(), targetPos);
QVERIFY(!workspace()->getMovingClient());
QVERIFY(!workspace()->moveResizeClient());
QCOMPARE(quickTileChangedSpy.count(), 1);
QTEST(c->quickTileMode(), "expectedMode");
......@@ -427,7 +427,7 @@ void QuickTilingTest::testQuickTilingPointerMove()
QVERIFY(quickTileChangedSpy.isValid());
workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp);
QCOMPARE(c, workspace()->getMovingClient());
QCOMPARE(c, workspace()->moveResizeClient());
QCOMPARE(Cursor::pos(), QPoint(49, 24));
QFETCH(QPoint, targetPos);
......@@ -436,7 +436,7 @@ void QuickTilingTest::testQuickTilingPointerMove()
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++);
QCOMPARE(Cursor::pos(), targetPos);
QVERIFY(!workspace()->getMovingClient());
QVERIFY(!workspace()->moveResizeClient());
QCOMPARE(quickTileChangedSpy.count(), 1);
QTEST(c->quickTileMode(), "expectedMode");
......@@ -493,7 +493,7 @@ void QuickTilingTest::testQuickTilingPointerMoveXdgShell()
QVERIFY(quickTileChangedSpy.isValid());
workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp);
QCOMPARE(c, workspace()->getMovingClient());
QCOMPARE(c, workspace()->moveResizeClient());
QCOMPARE(Cursor::pos(), QPoint(49, 24));
QVERIFY(configureRequestedSpy.wait());
QCOMPARE(configureRequestedSpy.count(), 3);
......@@ -504,7 +504,7 @@ void QuickTilingTest::testQuickTilingPointerMoveXdgShell()
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++);
QCOMPARE(Cursor::pos(), targetPos);
QVERIFY(!workspace()->getMovingClient());
QVERIFY(!workspace()->moveResizeClient());
QCOMPARE(quickTileChangedSpy.count(), 1);
QTEST(c->quickTileMode(), "expectedMode");
......@@ -571,13 +571,13 @@ void QuickTilingTest::testQuickTilingTouchMoveXdgShell()
quint32 timestamp = 1;
kwinApp()->platform()->touchDown(0, QPointF(c->geometry().center().x(), c->geometry().y() + decoration->borderTop() / 2), timestamp++);
QVERIFY(configureRequestedSpy.wait());
QCOMPARE(c, workspace()->getMovingClient());
QCOMPARE(c, workspace()->moveResizeClient());
QCOMPARE(configureRequestedSpy.count(), 3);
QFETCH(QPoint, targetPos);
kwinApp()->platform()->touchMotion(0, targetPos, timestamp++);
kwinApp()->platform()->touchUp(0, timestamp++);
QVERIFY(!workspace()->getMovingClient());
QVERIFY(!workspace()->moveResizeClient());
QCOMPARE(quickTileChangedSpy.count(), 1);
QTEST(c->quickTileMode(), "expectedMode");
......
......@@ -943,7 +943,7 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens()
const QRect origGeo = client2->geometry();
Cursor::setPos(origGeo.center());
workspace()->performWindowOperation(client2, Options::MoveOp);
QTRY_COMPARE(workspace()->getMovingClient(), client2);
QTRY_COMPARE(workspace()->moveResizeClient(), client2);
QVERIFY(client2->isMove());
// move to next screen - step is 8 pixel, so 800 pixel
for (int i = 0; i < 100; i++) {
......@@ -952,7 +952,7 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens()
}
client2->keyPressEvent(Qt::Key_Enter);
QCOMPARE(client2->isMove(), false);
QVERIFY(workspace()->getMovingClient() == nullptr);
QVERIFY(workspace()->moveResizeClient() == nullptr);
QCOMPARE(client2->geometry(), QRect(origGeo.translated(-800, 0)));
}
......
......@@ -28,7 +28,7 @@ Workspace *MockWorkspace::s_self = nullptr;
MockWorkspace::MockWorkspace(QObject *parent)
: QObject(parent)
, m_activeClient(nullptr)
, m_movingClient(nullptr)
, m_moveResizeClient(nullptr)
, m_showingDesktop(false)
{
s_self = this;
......@@ -49,14 +49,14 @@ void MockWorkspace::setActiveClient(AbstractClient *c)
m_activeClient = c;
}
AbstractClient *MockWorkspace::getMovingClient() const
AbstractClient *MockWorkspace::moveResizeClient() const
{
return m_movingClient;
return m_moveResizeClient;
}
void MockWorkspace::setMovingClient(AbstractClient *c)
void MockWorkspace::setMoveResizeClient(AbstractClient *c)
{
m_movingClient = c;
m_moveResizeClient = c;
}
void MockWorkspace::setShowingDesktop(bool showing)
......
......@@ -40,13 +40,13 @@ public:
explicit MockWorkspace(QObject *parent = nullptr);
virtual ~MockWorkspace();
AbstractClient *activeClient() const;
AbstractClient *getMovingClient() const;
AbstractClient *moveResizeClient() const;
void setShowingDesktop(bool showing);
bool showingDesktop() const;
QRect clientArea(clientAreaOption, int screen, int desktop) const;
void setActiveClient(AbstractClient *c);
void setMovingClient(AbstractClient *c);
void setMoveResizeClient(AbstractClient *c);
void registerEventFilter(X11EventFilter *filter);
void unregisterEventFilter(X11EventFilter *filter);
......@@ -62,7 +62,7 @@ Q_SIGNALS:
private:
AbstractClient *m_activeClient;
AbstractClient *m_movingClient;
AbstractClient *m_moveResizeClient;
bool m_showingDesktop;
static Workspace *s_self;
};
......
......@@ -396,7 +396,7 @@ void TestScreenEdges::testCreatingInitialEdges()
// let's start a move of window.
Client client(workspace());
workspace()->setMovingClient(&client);
workspace()->setMoveResizeClient(&client);
for (int i = 0; i < 8; ++i) {
auto e = edges.at(i);
QVERIFY(!e->isReserved());
......@@ -413,7 +413,7 @@ void TestScreenEdges::testCreatingInitialEdges()
QCOMPARE(e->activatesForTouchGesture(), false);
QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1));
}
workspace()->setMovingClient(nullptr);
workspace()->setMoveResizeClient(nullptr);
}
void TestScreenEdges::testCallback()
......
......@@ -882,9 +882,9 @@ QRect Workspace::adjustClientSize(AbstractClient* c, QRect moveResizeGeom, int m
}
/**
* Marks the client as being moved around by the user.
* Marks the client as being moved or resized by the user.
**/
void Workspace::setClientIsMoving(AbstractClient *c)
void Workspace::setMoveResizeClient(AbstractClient *c)
{
Q_ASSERT(!c || !movingClient); // Catch attempts to move a second
// window while still moving the first one.
......@@ -2663,7 +2663,7 @@ bool AbstractClient::startMoveResize()
invalidateDecorationDoubleClickTimer();
setMoveResize(true);
workspace()->setClientIsMoving(this);
workspace()->setMoveResizeClient(this);
const Position mode = moveResizePointerMode();
if (mode != PositionCenter) { // means "isResize()" but moveResizeMode = true is set below
......
......@@ -442,7 +442,7 @@ class MoveResizeFilter : public InputEventFilter {
public:
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override {
Q_UNUSED(nativeButton)
AbstractClient *c = workspace()->getMovingClient();
AbstractClient *c = workspace()->moveResizeClient();
if (!c) {
return false;
}
......@@ -463,10 +463,10 @@ public:
bool wheelEvent(QWheelEvent *event) override {
Q_UNUSED(event)
// filter out while moving a window
return workspace()->getMovingClient() != nullptr;
return workspace()->moveResizeClient() != nullptr;
}
bool keyEvent(QKeyEvent *event) override {
AbstractClient *c = workspace()->getMovingClient();
AbstractClient *c = workspace()->moveResizeClient();
if (!c) {
return false;
}
......@@ -484,7 +484,7 @@ public:
Q_UNUSED(id)
Q_UNUSED(pos)
Q_UNUSED(time)
AbstractClient *c = workspace()->getMovingClient();
AbstractClient *c = workspace()->moveResizeClient();
if (!c) {
return false;
}
......@@ -493,7 +493,7 @@ public:
bool touchMotion(quint32 id, const QPointF &pos, quint32 time) override {
Q_UNUSED(time)
AbstractClient *c = workspace()->getMovingClient();
AbstractClient *c = workspace()->moveResizeClient();
if (!c) {
return false;
}
......@@ -509,7 +509,7 @@ public:
bool touchUp(quint32 id, quint32 time) override {
Q_UNUSED(time)
AbstractClient *c = workspace()->getMovingClient();
AbstractClient *c = workspace()->moveResizeClient();
if (!c) {
return false;
}
......
......@@ -33,7 +33,7 @@ MovingClientX11Filter::MovingClientX11Filter()
bool MovingClientX11Filter::event(xcb_generic_event_t *event)
{
auto client = dynamic_cast<Client*>(workspace()->getMovingClient());
auto client = dynamic_cast<Client*>(workspace()->moveResizeClient());
if (!client) {
return false;
}
......
......@@ -583,7 +583,7 @@ void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow
return;
}
// TODO: can we check on the client instead?
if (workspace()->getMovingClient()) {
if (workspace()->moveResizeClient()) {
// don't update while moving
return;
}
......@@ -1108,7 +1108,7 @@ void CursorImage::updateMoveResize()
{
m_moveResizeCursor.image = QImage();
m_moveResizeCursor.hotSpot = QPoint();
if (AbstractClient *c = workspace()->getMovingClient()) {
if (AbstractClient *c = workspace()->moveResizeClient()) {
loadThemeCursor(c->cursor(), &m_moveResizeCursor);
if (m_currentSource == CursorSource::MoveResize) {
emit changed();
......@@ -1337,7 +1337,7 @@ void CursorImage::reevaluteSource()
setSource(CursorSource::EffectsOverride);
return;
}
if (workspace() && workspace()->getMovingClient()) {
if (workspace() && workspace()->moveResizeClient()) {
setSource(CursorSource::MoveResize);
return;
}
......
......@@ -183,7 +183,7 @@ bool Edge::activatesForPointer() const
return true;
}
if (m_edges->isDesktopSwitchingMovingClients()) {
auto c = Workspace::self()->getMovingClient();
auto c = Workspace::self()->moveResizeClient();
if (c && !c->isResize()) {
return true;
}
......@@ -297,7 +297,7 @@ bool Edge::canActivate(const QPoint &cursorPos, const QDateTime &triggerTime)
void Edge::handle(const QPoint &cursorPos)
{
AbstractClient *movingClient = Workspace::self()->getMovingClient();
AbstractClient *movingClient = Workspace::self()->moveResizeClient();
if ((edges()->isDesktopSwitchingMovingClients() && movingClient && !movingClient->isResize()) ||
(edges()->isDesktopSwitching() && isScreenEdge())) {
// always switch desktops in case:
......@@ -436,7 +436,7 @@ void Edge::switchDesktop(const QPoint &cursorPos)
pos.setY(OFFSET);
}
#ifndef KWIN_UNIT_TEST
if (AbstractClient *c = Workspace::self()->getMovingClient()) {
if (AbstractClient *c = Workspace::self()->moveResizeClient()) {
if (c->rules()->checkDesktop(desktop) != int(desktop)) {
// user attempts to move a client to another desktop where it is ruleforced to not be
return;
......
......@@ -1564,9 +1564,9 @@ void windowToDesktop(AbstractClient *c)
const auto desktop = functor(nullptr, true);
if (c && !c->isDesktop()
&& !c->isDock()) {
ws->setClientIsMoving(c);
ws->setMoveResizeClient(c);
vds->setCurrent(desktop);
ws->setClientIsMoving(NULL);
ws->setMoveResizeClient(nullptr);
}
}
......@@ -1609,9 +1609,9 @@ void activeClientToDesktop()
if (d == current) {
return;
}
ws->setClientIsMoving(ws->activeClient());
ws->setMoveResizeClient(ws->activeClient());
vds->setCurrent(d);
ws->setClientIsMoving(NULL);
ws->setMoveResizeClient(nullptr);
}
void Workspace::slotWindowToDesktopRight()
......
......@@ -186,9 +186,9 @@ public:
}
/**
* Indicates that the client c is being moved around by the user.
* Indicates that the client c is being moved or resized by the user.
**/
void setClientIsMoving(AbstractClient* c);
void setMoveResizeClient(AbstractClient* c);
QPoint adjustClientPosition(AbstractClient* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0);
QRect adjustClientSize(AbstractClient* c, QRect moveResizeGeom, int mode);
......@@ -361,7 +361,12 @@ public:
void updateFocusMousePosition(const QPoint& pos);
QPoint focusMousePosition() const;
AbstractClient* getMovingClient() {
/**
* Returns a client that is currently being moved or resized by the user.
*
* If none of clients is being moved or resized, @c null will be returned.
**/
AbstractClient* moveResizeClient() {
return movingClient;
}
......
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