|
|
|
@ -25,7 +25,6 @@
|
|
|
|
|
#include "../abstractwindowinterface.h"
|
|
|
|
|
#include "../tasktools.h"
|
|
|
|
|
#include "../../view/view.h"
|
|
|
|
|
#include "../../view/visibilitymanager.h"
|
|
|
|
|
|
|
|
|
|
// Qt
|
|
|
|
|
#include <QDebug>
|
|
|
|
@ -322,16 +321,18 @@ void LastActiveWindow::requestClose()
|
|
|
|
|
m_wm->requestClose(m_winId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LastActiveWindow::requestMove(int localX, int localY)
|
|
|
|
|
void LastActiveWindow::requestMove(Latte::View *fromView, int localX, int localY)
|
|
|
|
|
{
|
|
|
|
|
QPoint globalPoint{m_trackedInfo->view()->x() + localX, m_trackedInfo->view()->y() + localY};
|
|
|
|
|
QPoint globalPoint{fromView->x() + localX, fromView->y() + localY};
|
|
|
|
|
|
|
|
|
|
m_wm->requestMoveWindow(m_winId, globalPoint);
|
|
|
|
|
|
|
|
|
|
auto viewId = m_winId;
|
|
|
|
|
|
|
|
|
|
//! This timer is needed because otherwise the mouse position
|
|
|
|
|
//! in the dragged window changes to TopLeft corner
|
|
|
|
|
QTimer::singleShot(250, this, [&]() {
|
|
|
|
|
m_wm->releaseMouseEventFor(m_trackedInfo->view()->winId());
|
|
|
|
|
QTimer::singleShot(250, this, [&, viewId]() {
|
|
|
|
|
m_wm->releaseMouseEventFor(viewId);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
emit draggingStarted();
|
|
|
|
|