Index: head/x11-toolkits/qt5-gui/Makefile =================================================================== --- head/x11-toolkits/qt5-gui/Makefile (revision 461140) +++ head/x11-toolkits/qt5-gui/Makefile (revision 461141) @@ -1,94 +1,94 @@ # $FreeBSD$ PORTNAME= gui DISTVERSION= ${QT5_VERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-toolkits graphics PKGNAMEPREFIX= qt5- MAINTAINER= kde@FreeBSD.org COMMENT= Qt graphical user interface module BUILD_DEPENDS= at-spi2-core>=0:accessibility/at-spi2-core LIB_DEPENDS= libdbus-1.so:devel/dbus \ libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libpng.so:graphics/png \ libxcb.so:x11/libxcb \ libxcb-image.so:x11/xcb-util-image \ libxcb-keysyms.so:x11/xcb-util-keysyms \ libxcb-render-util.so:x11/xcb-util-renderutil \ libxcb-icccm.so:x11/xcb-util-wm \ libxkbcommon.so:x11/libxkbcommon RUN_DEPENDS= xdg-open:devel/xdg-utils USES= jpeg localbase USE_GL= gl egl USE_GNOME= glib20 USE_QT5= core dbus network qmake_build buildtools_build QT_DIST= base USE_XORG= ice sm x11 xi xrender HAS_CONFIGURE= yes CONFIGURE_ARGS= -no-eglfs \ -no-evdev \ -system-harfbuzz USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} BUILD_WRKSRC= ${WRKSRC}/src/${PORTNAME} INSTALL_WRKSRC= ${BUILD_WRKSRC} # Build and install QtPlatformSupport and default QPA plugins (XCB, # minimal and offscreen). QtGui won't work without (one of) them, but # they depend on QtGui itself, so they can't be added as dependencies. # QtPlatformSupport doesn't need to be installed (it's a static # library), but might be needed by people porting Qt on new platforms. MORE_WRKSRCS= src/platformheaders \ src/platformsupport \ src/plugins/platforms \ src/plugins/generic # Image formats are split through different tarballs, these are the # main ones; input contexts require no additional dependency. MORE_WRKSRCS+= src/plugins/imageformats \ src/plugins/platforminputcontexts # openglextensions is the static library to use for further things like qtcanvas3d MORE_WRKSRCS+= src/openglextensions QT_DEFINES= ACCESSIBILITY DBUS FONTCONFIG FREETYPE GLIB \ IMAGEFORMAT_PNG OPENGL SHAPE XCB XKB XKBCOMMON XRENDER QT_CONFIG= accessibility accessibility-atspi-bridge dbus \ fontconfig glib opengl png system-freetype \ system-jpeg system-png xcb xcb-glx xcb-render \ xcb-xlib xinput2 xlib xrender # Inherited from Qt 4. .if defined(PACKAGE_BUILDING) RUN_DEPENDS+= ${LOCALBASE}/share/fonts/encodings/encodings.dir:x11-fonts/encodings \ xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype .endif CFLAGS_powerpc64= -mminimal-toc post-configure: .for d in src/gui ${MORE_WRKSRCS} ${MKDIR} ${WRKSRC}/${d} cd ${WRKSRC}/${d} && ${SETENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} ${WRKSRC}/${d} .endfor post-build: .for d in ${MORE_WRKSRCS} @cd ${WRKSRC}/${d} && \ ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} \ ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET} .endfor post-install: .for d in ${MORE_WRKSRCS} @cd ${WRKSRC}/${d} && \ ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} \ ${MAKE_ARGS} ${INSTALL_TARGET} .endfor .include Index: head/x11-toolkits/qt5-gui/files/patch-git_4a7771f2 =================================================================== --- head/x11-toolkits/qt5-gui/files/patch-git_4a7771f2 (nonexistent) +++ head/x11-toolkits/qt5-gui/files/patch-git_4a7771f2 (revision 461141) @@ -0,0 +1,170 @@ +From 4a7771f206d4b29be549d3827c36a46679d90de6 Mon Sep 17 00:00:00 2001 +From: Eike Hein +Date: Sun, 7 Jan 2018 13:02:01 +0900 +Subject: [PATCH] QSimpleDrag: Fix mouse release coords for delayed event + transmission + +On platforms such as XCB, the drag cursor pixmap is shown via a window +(a QShapedPixmapWindow) under the cursor. + +The mouse button release event at the end of the drag is received in +this QXcbWindow, but intercepted by an event filter that QSimpleDrag +installs on the QApplication. It then resends it unmodified(!) after +the drag has ended and the drag pixmap window destroyed, causing it to +be delivered to the new top-level window. + +The local coordinates in the unmodified QMouseEvent are local to the +drag pixmap window and don't match the window it is delayed-transmitted +to. + +This ends up having fatal, user-visible effects particularly in Qt +Quick: QQuickWindow synthesizes a hover event once per frame using +the last received mouse coordinates, here: the release posted by +QSimpleDrag. This is done to update the hover event state for items +under the cursor when the mouse hasn't moved (e.g. QQuickMouseArea:: +containsMouse). The bogus event coordinates in the release event then +usually end up causing an item near the top-left of the QQuickWindow +to assume it is hovered (because drag pixmap windows tend to be small), +even when the mouse cursor is actually far away from it at the end of +the drag. + +This shows up e.g. in the Plasma 5 desktop, where dragging an icon +on the desktop will cause the icon at the top-left of the screen (if +any) to switch to hovered state, as the release coordinates on the +drag pixmap window (showing a dragged icon) fall into the geometry +of the top-left icon. + +QSimpleDrag contains a topLevelAt() function to find the top-level +window under the global cursor coordinates that is not the drag +pixmap window. This is used by the drop event delivery code. + +This patch uses this function to find the relevant top-level window, +then asks it to map the global cusor coordinates to its local +coordinate system, then synthesizes a new QMouseEvent with local +coordinates computed in this fashion. As a result the window now +gets a release event with coordinates that make sense and are +correct. + +Task-number: QTBUG-66103 +Change-Id: I04ebe6ccd4a991fdd4b540ff0227973ea8896a9d +Reviewed-by: Eike Hein +Reviewed-by: Shawn Rutledge +--- + src/gui/kernel/qsimpledrag.cpp | 32 +++++++++++++++++++++++++++----- + src/gui/kernel/qsimpledrag_p.h | 6 +++--- + 2 files changed, 30 insertions(+), 8 deletions(-) + +diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp +index a1e25dc5..87d3ba59 100644 +--- src/gui/kernel/qsimpledrag.cpp ++++ src/gui/kernel/qsimpledrag.cpp +@@ -58,6 +58,7 @@ + + #include + #include ++#include + + #include + #include +@@ -69,6 +70,8 @@ QT_BEGIN_NAMESPACE + + #ifndef QT_NO_DRAGANDDROP + ++Q_LOGGING_CATEGORY(lcDnd, "qt.gui.dnd") ++ + static QWindow* topLevelAt(const QPoint &pos) + { + QWindowList list = QGuiApplication::topLevelWindows(); +@@ -94,10 +97,10 @@ static QWindow* topLevelAt(const QPoint &pos) + */ + + QBasicDrag::QBasicDrag() : +- m_restoreCursor(false), m_eventLoop(0), ++ m_current_window(nullptr), m_restoreCursor(false), m_eventLoop(nullptr), + m_executed_drop_action(Qt::IgnoreAction), m_can_drop(false), +- m_drag(0), m_drag_icon_window(0), m_useCompositing(true), +- m_screen(Q_NULLPTR) ++ m_drag(nullptr), m_drag_icon_window(nullptr), m_useCompositing(true), ++ m_screen(nullptr) + { + } + +@@ -161,6 +164,7 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e) + return true; // Eat all mouse move events + } + case QEvent::MouseButtonRelease: ++ { + disableEventFilter(); + if (canDrop()) { + QPoint nativePosition = getNativeMousePos(e, m_drag_icon_window); +@@ -169,8 +173,25 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e) + cancel(); + } + exitDndEventLoop(); +- QCoreApplication::postEvent(o, new QMouseEvent(*static_cast(e))); ++ ++ // If a QShapedPixmapWindow (drag feedback) is being dragged along, the ++ // mouse event's localPos() will be relative to that, which is useless. ++ // We want a position relative to the window where the drag ends, if possible (?). ++ // If there is no such window (belonging to this Qt application), ++ // make the event relative to the window where the drag started. (QTBUG-66103) ++ const QMouseEvent *release = static_cast(e); ++ const QWindow *releaseWindow = topLevelAt(release->globalPos()); ++ qCDebug(lcDnd) << "mouse released over" << releaseWindow << "after drag from" << m_current_window << "globalPos" << release->globalPos(); ++ if (!releaseWindow) ++ releaseWindow = m_current_window; ++ QPoint releaseWindowPos = (releaseWindow ? releaseWindow->mapFromGlobal(release->globalPos()) : release->globalPos()); ++ QMouseEvent *newRelease = new QMouseEvent(release->type(), ++ releaseWindowPos, releaseWindowPos, release->screenPos(), ++ release->button(), release->buttons(), ++ release->modifiers(), release->source()); ++ QCoreApplication::postEvent(o, newRelease); + return true; // defer mouse release events until drag event loop has returned ++ } + case QEvent::MouseButtonDblClick: + case QEvent::Wheel: + return true; +@@ -349,7 +370,7 @@ static inline QPoint fromNativeGlobalPixels(const QPoint &point) + into account. + */ + +-QSimpleDrag::QSimpleDrag() : m_current_window(0) ++QSimpleDrag::QSimpleDrag() + { + } + +@@ -373,6 +394,7 @@ void QSimpleDrag::startDrag() + updateCursor(Qt::IgnoreAction); + } + setExecutedDropAction(Qt::IgnoreAction); ++ qCDebug(lcDnd) << "drag began from" << m_current_window<< "cursor pos" << QCursor::pos() << "can drop?" << canDrop(); + } + + void QSimpleDrag::cancel() +diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h +index 0b8a0bc7..bbd7f7f4 100644 +--- src/gui/kernel/qsimpledrag_p.h ++++ src/gui/kernel/qsimpledrag_p.h +@@ -105,6 +105,9 @@ protected: + + QDrag *drag() const { return m_drag; } + ++protected: ++ QWindow *m_current_window; ++ + private: + void enableEventFilter(); + void disableEventFilter(); +@@ -132,9 +135,6 @@ protected: + virtual void cancel() Q_DECL_OVERRIDE; + virtual void move(const QPoint &globalPos) Q_DECL_OVERRIDE; + virtual void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; +- +-private: +- QWindow *m_current_window; + }; + + #endif // QT_NO_DRAGANDDROP +-- +2.15.1 + Property changes on: head/x11-toolkits/qt5-gui/files/patch-git_4a7771f2 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property