From a0aad95f5ad1ff044f5e46cf2d3302c42d058f6a Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Tue, 8 Sep 2015 17:59:17 +0300 Subject: Set the source for a detached mouse button event If a mouse event from the window system changes both position and buttons at the same time, then it's split by QGuiApplication into a mouse move event followed by a mouse button event. Propagate the source of the original mouse event to the mouse button event. Change-Id: I075fb4ad9e4338bf8ec170630ce270b38d8682d9 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index fc87759227..94c831e18c 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1713,7 +1713,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo // should first send a move event followed by a button changed event. Since this is not the case // with the current event, we split it in two. QWindowSystemInterfacePrivate::MouseEvent mouseButtonEvent( - e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers); + e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers, e->source); if (e->flags & QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic) mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic; e->buttons = buttons; -- cgit v1.2.3