Start using the new wl_fixed_t type properly
The mouse and touch coordinates cannot just be treated as integers anymore, they need to be converted from/to double using the helper functions. Some necessary QPoint -> QPointF changes have also been made. For the Qt-specific touch extension we will not switch to wl_fixed_t though. This is because the precision is unfortunately quite small (factor of 256 vs. 10000). Change-Id: I23deaaffe478a39495b12d336985bc62e38a6af4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
parent
66e41e57a8
commit
837edd2e78
@ -106,8 +106,10 @@ void Compositor::sendMousePress(void *data, const QList<QVariant> ¶meters)
|
||||
return;
|
||||
|
||||
QPoint pos = parameters.last().toPoint();
|
||||
wl_input_device_set_pointer_focus(&compositor->m_input, surface, pos.x(), pos.y());
|
||||
wl_input_device_send_motion(compositor->m_input.pointer_focus_resource, compositor->time(), pos.x(), pos.y());
|
||||
wl_input_device_set_pointer_focus(&compositor->m_input, surface,
|
||||
wl_fixed_from_int(pos.x()), wl_fixed_from_int(pos.y()));
|
||||
wl_input_device_send_motion(compositor->m_input.pointer_focus_resource, compositor->time(),
|
||||
wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y()));
|
||||
wl_input_device_send_button(compositor->m_input.pointer_focus_resource,
|
||||
compositor->nextSerial(), compositor->time(), 0x110, 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user