Commit 9f2f6cc8 authored by David Redondo's avatar David Redondo 🏎
Browse files

Pager: Move the correct windows on drag and drop

We were moving random windows since we converted the id of the window that
should be moved and the ids from the model which are uuids to ints which
returns 0.
parent 3266a111
......@@ -425,7 +425,7 @@ MouseArea {
z: 1 + model.StackingOrder
property rect geometry: model.Geometry
property int windowId: model.WinIdList[0]
property var windowId: model.WinIdList[0]
property string visibleName: model.display
property bool minimized: (model.IsMinimized === true)
onMinimizedChanged: desktop.updateSubText()
......
......@@ -450,7 +450,7 @@ void PagerModel::refresh()
emit countChanged();
}
void PagerModel::moveWindow(int window,
void PagerModel::moveWindow(const QVariant &window,
double x,
double y,
const QVariant &targetItemId,
......@@ -460,7 +460,7 @@ void PagerModel::moveWindow(int window,
{
#if HAVE_X11
if (KWindowSystem::isPlatformX11()) {
const WId windowId = (WId)window;
const WId windowId = window.toUInt();
QPointF dest(x / widthScaleFactor, y / heightScaleFactor);
......@@ -528,8 +528,7 @@ void PagerModel::moveWindow(int window,
}
const QVariantList &winIds = idx.data(TaskManager::AbstractTasksModel::WinIdList).toList();
if (!winIds.isEmpty() && winIds.at(0).toInt() == window) {
if (!winIds.isEmpty() && winIds.at(0) == window) {
tasksModel->requestVirtualDesktops(idx, QVariantList() << targetItemId.toString());
break;
}
......
......@@ -100,7 +100,7 @@ public:
Q_INVOKABLE void refresh();
Q_INVOKABLE void
moveWindow(int window, double x, double y, const QVariant &targetItemId, const QVariant &sourceItemId, qreal widthScaleFactor, qreal heightScaleFactor);
moveWindow(const QVariant &window, double x, double y, const QVariant &targetItemId, const QVariant &sourceItemId, qreal widthScaleFactor, qreal heightScaleFactor);
Q_INVOKABLE void changePage(int page);
Q_INVOKABLE void drop(QMimeData *mimeData, int modifiers, const QVariant &itemId);
Q_INVOKABLE void addDesktop();
......
Supports Markdown
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