diff --git a/qmake/core.pri b/qmake/core.pri index 26df370..08761c4 100644 --- a/qmake/core.pri +++ b/qmake/core.pri @@ -56,15 +56,14 @@ win32 { $$CORE_SRC_DIR/utils_win.cpp \ $$CORE_SRC_DIR/registrykey.cpp \ $$CORE_SRC_DIR/winverhelper.cpp - LIBS += -luser32 -lgdi32 + LIBS += -luser32 -lgdi32 -lshell32 } unix:!macx { CONFIG += link_pkgconfig - PKGCONFIG += gtk+-3.0 + PKGCONFIG += gtk+-3.0 xcb DEFINES += GDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6 SOURCES += $$CORE_SRC_DIR/utils_linux.cpp - #LIBS += -lxcb # TODO } macx { diff --git a/src/widgets/framelesswidgetshelper.cpp b/src/widgets/framelesswidgetshelper.cpp index 78b8694..c348678 100644 --- a/src/widgets/framelesswidgetshelper.cpp +++ b/src/widgets/framelesswidgetshelper.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -552,7 +553,7 @@ bool FramelessWidgetsHelperPrivate::isInSystemButtons(const QPoint &pos, SystemB return false; } -bool FramelessWidgetsHelperPrivate::isInTitleBarDraggableArea(const QPoint &pos) const +bool FramelessWidgetsHelperPrivate::isInTitleBarDraggableArea(const QPoint &localPos) const { const WidgetsHelperData data = getWindowData(); if (!data.titleBarWidget) { @@ -597,7 +598,14 @@ bool FramelessWidgetsHelperPrivate::isInTitleBarDraggableArea(const QPoint &pos) } } } - return region.contains(pos); + if (!region.contains(localPos)) { + return false; + } + const QPoint globalPos = m_window->mapToGlobal(localPos); + // Don't move the window if the user is dragging something above the title bar widget, + // according to the Qt documentation, QApplication::widgetAt() can be slow, but we really + // can't avoid calling it here. + return (QApplication::widgetAt(globalPos) == data.titleBarWidget); } bool FramelessWidgetsHelperPrivate::shouldIgnoreMouseEvents(const QPoint &pos) const