Fixed swipe-to-reply on macOS.

This commit is contained in:
23rd 2024-09-03 17:01:33 +03:00 committed by John Preston
parent 300f35e78f
commit f8c820f319

View file

@ -140,12 +140,12 @@ void SetupSwipeHandler(
const auto filter = [=](not_null<QEvent*> e) { const auto filter = [=](not_null<QEvent*> e) {
const auto type = e->type(); const auto type = e->type();
switch (type) { switch (type) {
case QEvent::Leave: case QEvent::Leave: {
if (state->orientation) { if (state->orientation) {
processEnd(); processEnd();
} }
break; } break;
case QEvent::MouseMove: case QEvent::MouseMove: {
if (state->orientation) { if (state->orientation) {
const auto m = static_cast<QMouseEvent*>(e.get()); const auto m = static_cast<QMouseEvent*>(e.get());
if (std::abs(m->pos().y() - state->cursorTop) if (std::abs(m->pos().y() - state->cursorTop)
@ -153,14 +153,14 @@ void SetupSwipeHandler(
processEnd(); processEnd();
} }
} }
break; } break;
case QEvent::TouchBegin: case QEvent::TouchBegin:
case QEvent::TouchUpdate: case QEvent::TouchUpdate:
case QEvent::TouchEnd: case QEvent::TouchEnd:
case QEvent::TouchCancel: { case QEvent::TouchCancel: {
const auto t = static_cast<QTouchEvent*>(e.get()); const auto t = static_cast<QTouchEvent*>(e.get());
const auto touchscreen = t->device() const auto touchscreen = t->device()
&& (t->device()->type() != base::TouchDevice::TouchScreen); && (t->device()->type() == base::TouchDevice::TouchScreen);
if (!Platform::IsMac() && !touchscreen) { if (!Platform::IsMac() && !touchscreen) {
break; break;
} }