diff --git a/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -1330,7 +1330,7 @@ performMoveResize(); if (isMove()) { - ScreenEdges::self()->check(globalPos, QDateTime::fromMSecsSinceEpoch(xTime())); + ScreenEdges::self()->check(globalPos, QDateTime::fromMSecsSinceEpoch(xTime(), Qt::UTC)); } } diff --git a/autotests/test_screen_edges.cpp b/autotests/test_screen_edges.cpp --- a/autotests/test_screen_edges.cpp +++ b/autotests/test_screen_edges.cpp @@ -468,7 +468,7 @@ event.time = QDateTime::currentMSecsSinceEpoch(); setPos(QPoint(0, 50)); auto isEntered = [s] (xcb_enter_notify_event_t *event) { - return s->handleEnterNotifiy(event->event, QPoint(event->root_x, event->root_y), QDateTime::fromMSecsSinceEpoch(event->time)); + return s->handleEnterNotifiy(event->event, QPoint(event->root_x, event->root_y), QDateTime::fromMSecsSinceEpoch(event->time, Qt::UTC)); }; QVERIFY(isEntered(&event)); // doesn't trigger as the edge was not triggered yet @@ -574,27 +574,27 @@ s->reserve(ElectricLeft, &callback, "callback"); // check activating a different edge doesn't do anything - s->check(QPoint(50, 0), QDateTime::currentDateTime(), true); + s->check(QPoint(50, 0), QDateTime::currentDateTimeUtc(), true); QVERIFY(spy.isEmpty()); // try a direct activate without pushback Cursor::setPos(0, 50); - s->check(QPoint(0, 50), QDateTime::currentDateTime(), true); + s->check(QPoint(0, 50), QDateTime::currentDateTimeUtc(), true); QCOMPARE(spy.count(), 1); QEXPECT_FAIL("", "Argument says force no pushback, but it gets pushed back. Needs investigation", Continue); QCOMPARE(Cursor::pos(), QPoint(0, 50)); // use a different edge, this time with pushback s->reserve(KWin::ElectricRight, &callback, "callback"); Cursor::setPos(99, 50); - s->check(QPoint(99, 50), QDateTime::currentDateTime()); + s->check(QPoint(99, 50), QDateTime::currentDateTimeUtc()); QCOMPARE(spy.count(), 1); QCOMPARE(spy.last().first().value(), ElectricLeft); QCOMPARE(Cursor::pos(), QPoint(98, 50)); // and trigger it again QTest::qWait(160); Cursor::setPos(99, 50); - s->check(QPoint(99, 50), QDateTime::currentDateTime()); + s->check(QPoint(99, 50), QDateTime::currentDateTimeUtc()); QCOMPARE(spy.count(), 2); QCOMPARE(spy.last().first().value(), ElectricRight); QCOMPARE(Cursor::pos(), QPoint(98, 50)); @@ -658,7 +658,7 @@ // do the same without the event, but the check method Cursor::setPos(trigger); - s->check(trigger, QDateTime::currentDateTime()); + s->check(trigger, QDateTime::currentDateTimeUtc()); QVERIFY(spy.isEmpty()); QTEST(Cursor::pos(), "expected"); } @@ -863,16 +863,16 @@ s->reserve(&client, KWin::ElectricTop); QCOMPARE(client.isHiddenInternal(), true); Cursor::setPos(50, 0); - s->check(QPoint(50, 0), QDateTime::currentDateTime()); + s->check(QPoint(50, 0), QDateTime::currentDateTimeUtc()); QCOMPARE(client.isHiddenInternal(), false); QCOMPARE(Cursor::pos(), QPoint(50, 1)); // unreserve by setting to none edge s->reserve(&client, KWin::ElectricNone); // check on previous edge again, should fail client.setHiddenInternal(true); Cursor::setPos(50, 0); - s->check(QPoint(50, 0), QDateTime::currentDateTime()); + s->check(QPoint(50, 0), QDateTime::currentDateTimeUtc()); QCOMPARE(client.isHiddenInternal(), true); QCOMPARE(Cursor::pos(), QPoint(50, 0)); @@ -960,12 +960,12 @@ event.time = QDateTime::currentMSecsSinceEpoch(); setPos(QPoint(0, 50)); auto isEntered = [s] (xcb_enter_notify_event_t *event) { - return s->handleEnterNotifiy(event->event, QPoint(event->root_x, event->root_y), QDateTime::fromMSecsSinceEpoch(event->time)); + return s->handleEnterNotifiy(event->event, QPoint(event->root_x, event->root_y), QDateTime::fromMSecsSinceEpoch(event->time, Qt::UTC)); }; QCOMPARE(isEntered(&event), false); QVERIFY(approachingSpy.isEmpty()); // let's also verify the check - s->check(QPoint(0, 50), QDateTime::currentDateTime(), false); + s->check(QPoint(0, 50), QDateTime::currentDateTimeUtc(), false); QVERIFY(approachingSpy.isEmpty()); s->gestureRecognizer()->startSwipeGesture(QPoint(0, 50)); diff --git a/plugins/platforms/x11/standalone/screenedges_filter.cpp b/plugins/platforms/x11/standalone/screenedges_filter.cpp --- a/plugins/platforms/x11/standalone/screenedges_filter.cpp +++ b/plugins/platforms/x11/standalone/screenedges_filter.cpp @@ -40,16 +40,16 @@ const auto mouseEvent = reinterpret_cast(event); const QPoint rootPos(mouseEvent->root_x, mouseEvent->root_y); if (QWidget::mouseGrabber()) { - ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); + ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime(), Qt::UTC), true); } else { - ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time)); + ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time, Qt::UTC)); } // not filtered out break; } case XCB_ENTER_NOTIFY: { const auto enter = reinterpret_cast(event); - return ScreenEdges::self()->handleEnterNotifiy(enter->event, QPoint(enter->root_x, enter->root_y), QDateTime::fromMSecsSinceEpoch(enter->time)); + return ScreenEdges::self()->handleEnterNotifiy(enter->event, QPoint(enter->root_x, enter->root_y), QDateTime::fromMSecsSinceEpoch(enter->time, Qt::UTC)); } case XCB_CLIENT_MESSAGE: { const auto ce = reinterpret_cast(event); diff --git a/screenedge.cpp b/screenedge.cpp --- a/screenedge.cpp +++ b/screenedge.cpp @@ -1394,7 +1394,7 @@ } } if (edge->geometry().contains(event->globalPos())) { - if (edge->check(event->globalPos(), QDateTime::fromMSecsSinceEpoch(event->timestamp()))) { + if (edge->check(event->globalPos(), QDateTime::fromMSecsSinceEpoch(event->timestamp(), Qt::UTC))) { if (edge->client()) { activatedForClient = true; } @@ -1404,7 +1404,7 @@ if (activatedForClient) { for (auto it = m_edges.constBegin(); it != m_edges.constEnd(); ++it) { if ((*it)->client()) { - (*it)->markAsTriggered(event->globalPos(), QDateTime::fromMSecsSinceEpoch(event->timestamp())); + (*it)->markAsTriggered(event->globalPos(), QDateTime::fromMSecsSinceEpoch(event->timestamp(), Qt::UTC)); } } } @@ -1460,7 +1460,7 @@ } if (edge->isReserved() && edge->window() == window) { updateXTime(); - edge->check(point, QDateTime::fromMSecsSinceEpoch(xTime()), true); + edge->check(point, QDateTime::fromMSecsSinceEpoch(xTime(), Qt::UTC), true); return true; } } diff --git a/tabbox/x11_filter.cpp b/tabbox/x11_filter.cpp --- a/tabbox/x11_filter.cpp +++ b/tabbox/x11_filter.cpp @@ -101,7 +101,7 @@ auto *mouseEvent = reinterpret_cast(event); const QPoint rootPos(mouseEvent->root_x, mouseEvent->root_y); // TODO: this should be in ScreenEdges directly - ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); + ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime(), Qt::UTC), true); xcb_allow_events(connection(), XCB_ALLOW_ASYNC_POINTER, XCB_CURRENT_TIME); }