summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2016-11-21 12:18:51 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2016-11-22 09:43:52 +0000
commit8493c29c0b739d0de2d79461695e615536031227 (patch)
tree1d913c6ec100186d4f37a3f7657b45db0fd3990b /examples
parentfc1901b4b34d29df79be1b9b1c1d3f5a127eaa59 (diff)
downloadqtwayland-8493c29c0b739d0de2d79461695e615536031227.tar.gz
Make sure we send leave events in the c++ example
The code was there, but an unfortunate null pointer check made us skip sending leave events. Change-Id: I3095949ac41330fc10e2a97c025d94d47bc6ea4e Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/qwindow-compositor/window.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp
index 371e0de8..a61e4d98 100644
--- a/examples/wayland/qwindow-compositor/window.cpp
+++ b/examples/wayland/qwindow-compositor/window.cpp
@@ -257,10 +257,9 @@ void Window::mouseMoveEvent(QMouseEvent *e)
void Window::sendMouseEvent(QMouseEvent *e, View *target)
{
- if (!target)
- return;
-
- QPointF mappedPos = e->localPos() - target->position();
+ QPointF mappedPos = e->localPos();
+ if (target)
+ mappedPos -= target->position();
QMouseEvent viewEvent(e->type(), mappedPos, e->localPos(), e->button(), e->buttons(), e->modifiers());
m_compositor->handleMouseEvent(target, &viewEvent);
}