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