diff --git a/src/core/framelesswindowsmanager.cpp b/src/core/framelesswindowsmanager.cpp index bc4d852..e8ed451 100644 --- a/src/core/framelesswindowsmanager.cpp +++ b/src/core/framelesswindowsmanager.cpp @@ -275,12 +275,12 @@ void FramelessHelper::Core::initialize(const Options options) // and resize by yourself. Utils::tryToEnableHighestDpiAwarenessLevel(); } +#endif if (!(options & Option::DontEnsureNonNativeWidgetSiblings)) { // This attribute is known to be __NOT__ compatible with QGLWidget. // Please consider migrating to the recommended QOpenGLWidget instead. QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); } -#endif #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) if (!(options & Option::DontTouchHighDpiScalingPolicy)) { // Enable high DPI scaling by default, but only for Qt5 applications, diff --git a/src/core/utils.cpp b/src/core/utils.cpp index 621302a..ad55536 100644 --- a/src/core/utils.cpp +++ b/src/core/utils.cpp @@ -59,6 +59,11 @@ FRAMELESSHELPER_STRING_CONSTANT(highcontrast) Qt::CursorShape Utils::calculateCursorShape(const QWindow *window, const QPoint &pos) { +#ifdef Q_OS_MACOS + Q_UNUSED(window); + Q_UNUSED(pos); + return Qt::ArrowCursor; +#else Q_ASSERT(window); if (!window) { return Qt::ArrowCursor; @@ -81,10 +86,16 @@ Qt::CursorShape Utils::calculateCursorShape(const QWindow *window, const QPoint return Qt::SizeVerCursor; } return Qt::ArrowCursor; +#endif } Qt::Edges Utils::calculateWindowEdges(const QWindow *window, const QPoint &pos) { +#ifdef Q_OS_MACOS + Q_UNUSED(window); + Q_UNUSED(pos); + return {}; +#else Q_ASSERT(window); if (!window) { return {}; @@ -106,6 +117,7 @@ Qt::Edges Utils::calculateWindowEdges(const QWindow *window, const QPoint &pos) edges |= Qt::BottomEdge; } return edges; +#endif } QVariant Utils::getSystemButtonIconResource diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index bd35f4a..a97b1db 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -81,7 +81,7 @@ else() endif() target_link_libraries(${SUB_PROJ_NAME} PRIVATE - Qt${QT_VERSION_MAJOR}::Widgets + Qt${QT_VERSION_MAJOR}::WidgetsPrivate ) target_link_libraries(${SUB_PROJ_NAME} PUBLIC diff --git a/src/widgets/framelesswidgetshelper.cpp b/src/widgets/framelesswidgetshelper.cpp index 442cedb..a9cb01a 100644 --- a/src/widgets/framelesswidgetshelper.cpp +++ b/src/widgets/framelesswidgetshelper.cpp @@ -352,7 +352,6 @@ void FramelessWidgetsHelper::initialize() m_initialized = true; // Let the user be able to get the helper class instance from outside. q->setProperty(FRAMELESSHELPER_PROP_NAME, QVariant::fromValue(this)); -#ifdef Q_OS_WINDOWS // Without this flag, Qt will always create an invisible native parent window // for any native widgets which will intercept some win32 messages and confuse // our own native event filter, so to prevent some weired bugs from happening, @@ -361,7 +360,6 @@ void FramelessWidgetsHelper::initialize() // Force the widget become a native window now so that we can deal with its // win32 events as soon as possible. q->setAttribute(Qt::WA_NativeWindow); -#endif m_params.getWindowId = [this]() -> WId { return q->winId(); }; m_params.getWindowFlags = [this]() -> Qt::WindowFlags { return q->windowFlags(); }; m_params.setWindowFlags = [this](const Qt::WindowFlags flags) -> void { q->setWindowFlags(flags); };