From: Samuel Rødal Date: Wed, 16 Mar 2011 11:29:12 +0000 (+0100) Subject: Fixed wrong coordinates sent for button press events. X-Git-Tag: qt-v5.0.0-alpha1~352 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7526b585e0dd35afc4beb01b303439442c8cb31;p=profile%2Fivi%2Fqtwayland.git Fixed wrong coordinates sent for button press events. --- diff --git a/src/qt-compositor/private/wlsurface.cpp b/src/qt-compositor/private/wlsurface.cpp index ebdb8df..ae226b2 100644 --- a/src/qt-compositor/private/wlsurface.cpp +++ b/src/qt-compositor/private/wlsurface.cpp @@ -244,21 +244,23 @@ uint32_t toWaylandButton(Qt::MouseButton button) void Surface::sendMousePressEvent(int x, int y, Qt::MouseButton button) { Q_D(Surface); + sendMouseMoveEvent(x, y); if (d->client) { uint32_t time = d->compositor->currentTimeMsecs(); wl_client_post_event(d->client, &d->compositor->defaultInputDevice()->object, WL_INPUT_DEVICE_BUTTON, time, toWaylandButton(button), 1); } - sendMouseMoveEvent(x, y); } void Surface::sendMouseReleaseEvent(int x, int y, Qt::MouseButton button) { Q_D(Surface); - if (d->client) - wl_client_post_event(d->client, &d->compositor->defaultInputDevice()->object, - WL_INPUT_DEVICE_BUTTON, d->compositor->currentTimeMsecs(), toWaylandButton(button), 0); sendMouseMoveEvent(x, y); + if (d->client) { + uint32_t time = d->compositor->currentTimeMsecs(); + wl_client_post_event(d->client, &d->compositor->defaultInputDevice()->object, + WL_INPUT_DEVICE_BUTTON, time, toWaylandButton(button), 0); + } } void Surface::sendMouseMoveEvent(int x, int y)