diff --git a/ui/platform/mac/ui_window_mac.h b/ui/platform/mac/ui_window_mac.h index f4c9622..31dda13 100644 --- a/ui/platform/mac/ui_window_mac.h +++ b/ui/platform/mac/ui_window_mac.h @@ -41,14 +41,6 @@ private: const not_null _body; bool _titleVisible = true; -#ifdef OS_OSX - struct WindowDrag { - QPoint windowStartPosition; - QPoint dragStartPosition; - }; - std::optional _drag; -#endif // OS_OSX - }; } // namespace Platform diff --git a/ui/platform/mac/ui_window_mac.mm b/ui/platform/mac/ui_window_mac.mm index fe297a2..9ce90e5 100644 --- a/ui/platform/mac/ui_window_mac.mm +++ b/ui/platform/mac/ui_window_mac.mm @@ -367,7 +367,6 @@ void WindowHelper::setGeometry(QRect rect) { } void WindowHelper::setupBodyTitleAreaEvents() { -#ifndef OS_OSX const auto controls = _private->controlsRect(); qApp->installNativeEventFilter(new EventFilter(window(), [=](void *nswindow) { const auto point = body()->mapFromGlobal(QCursor::pos()); @@ -380,28 +379,6 @@ void WindowHelper::setupBodyTitleAreaEvents() { } return false; })); -#else // OS_OSX - // OS X 10.10 doesn't have performWindowDragWithEvent yet. - body()->events() | rpl::start_with_next([=](not_null e) { - const auto hitTest = [&] { - return bodyTitleAreaHit( - static_cast(e.get())->pos()); - }; - if (e->type() == QEvent::MouseButtonRelease - && (static_cast(e.get())->button() - == Qt::LeftButton)) { - _drag = std::nullopt; - } else if (e->type() == QEvent::MouseButtonPress - && hitTest() - && (static_cast(e.get())->button() - == Qt::LeftButton)) { - _drag = { window()->pos(), static_cast(e.get())->globalPos() }; - } else if (e->type() == QEvent::MouseMove && _drag && !window()->isFullScreen()) { - const auto delta = static_cast(e.get())->globalPos() - _drag->dragStartPosition; - window()->move(_drag->windowStartPosition + delta); - } - }, body()->lifetime()); -#endif // OS_OSX } void WindowHelper::close() {