diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2016-11-21 12:18:51 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2016-11-22 09:43:52 +0000 |
commit | 8493c29c0b739d0de2d79461695e615536031227 (patch) | |
tree | 1d913c6ec100186d4f37a3f7657b45db0fd3990b /examples | |
parent | fc1901b4b34d29df79be1b9b1c1d3f5a127eaa59 (diff) | |
download | qtwayland-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.cpp | 7 |
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); } |