Move moveResizeStartScreen from Client to AbstractClient

Initialized in updateInitialMoveResizeGeometry().
This commit is contained in:
Martin Gräßlin 2015-10-16 15:53:28 +02:00
parent dcb5e29316
commit dc04cdef64
4 changed files with 6 additions and 3 deletions

View file

@ -1063,6 +1063,7 @@ void AbstractClient::updateInitialMoveResizeGeometry()
{ {
m_moveResize.initialGeometry = geometry(); m_moveResize.initialGeometry = geometry();
m_moveResize.geometry = m_moveResize.initialGeometry; m_moveResize.geometry = m_moveResize.initialGeometry;
m_moveResize.startScreen = screen();
} }
void AbstractClient::updateCursor() void AbstractClient::updateCursor()

View file

@ -685,6 +685,9 @@ protected:
void setMoveResizePointerButtonDown(bool down) { void setMoveResizePointerButtonDown(bool down) {
m_moveResize.buttonDown = down; m_moveResize.buttonDown = down;
} }
int moveResizeStartScreen() const {
return m_moveResize.startScreen;
}
void checkUnrestrictedMoveResize(); void checkUnrestrictedMoveResize();
/** /**
* Sets an appropriate cursor shape for the logical mouse position. * Sets an appropriate cursor shape for the logical mouse position.
@ -747,6 +750,7 @@ private:
Position pointer = PositionCenter; Position pointer = PositionCenter;
bool buttonDown = false; bool buttonDown = false;
Qt::CursorShape cursor = Qt::ArrowCursor; Qt::CursorShape cursor = Qt::ArrowCursor;
int startScreen = 0;
} m_moveResize; } m_moveResize;
}; };

View file

@ -610,7 +610,6 @@ private:
bool m_blockedActivityUpdatesRequireTransients; bool m_blockedActivityUpdatesRequireTransients;
Xcb::Window m_moveResizeGrabWindow; Xcb::Window m_moveResizeGrabWindow;
bool move_resize_has_keyboard_grab; bool move_resize_has_keyboard_grab;
int moveResizeStartScreen;
static bool s_haveResizeEffect; static bool s_haveResizeEffect;
bool m_managed; bool m_managed;

View file

@ -2658,7 +2658,6 @@ bool Client::startMoveResize()
} }
s_haveResizeEffect = effects && static_cast<EffectsHandlerImpl*>(effects)->provides(Effect::Resize); s_haveResizeEffect = effects && static_cast<EffectsHandlerImpl*>(effects)->provides(Effect::Resize);
moveResizeStartScreen = screen();
updateInitialMoveResizeGeometry(); updateInitialMoveResizeGeometry();
checkUnrestrictedMoveResize(); checkUnrestrictedMoveResize();
emit clientStartUserMovedResized(this); emit clientStartUserMovedResized(this);
@ -2688,7 +2687,7 @@ void Client::finishMoveResize(bool cancel)
setGeometry(moveResizeGeom); setGeometry(moveResizeGeom);
} }
checkScreen(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment checkScreen(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment
if (screen() != moveResizeStartScreen) { if (screen() != moveResizeStartScreen()) {
workspace()->sendClientToScreen(this, screen()); // checks rule validity workspace()->sendClientToScreen(this, screen()); // checks rule validity
if (maximizeMode() != MaximizeRestore) if (maximizeMode() != MaximizeRestore)
checkWorkspacePosition(); checkWorkspacePosition();