DirectFB Unbreak mouse input for child windows
The local and global coordinates for mouse events were being translated incorrectly from the native DirectFB events. Change-Id: Id904a4335459b87c92f4b8b46d535c78fb7dad8c Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>bb10
parent
3fcebba79c
commit
6e7e73c014
|
|
@ -154,7 +154,7 @@ void QDirectFbInput::handleEvents()
|
|||
void QDirectFbInput::handleMouseEvents(const DFBEvent &event)
|
||||
{
|
||||
QPoint p(event.window.x, event.window.y);
|
||||
QPoint globalPos = globalPoint(event);
|
||||
QPoint globalPos(event.window.cx, event.window.cy);
|
||||
Qt::MouseButtons buttons = QDirectFbConvenience::mouseButtons(event.window.buttons);
|
||||
|
||||
QDirectFBPointer<IDirectFBDisplayLayer> layer(QDirectFbConvenience::dfbDisplayLayer());
|
||||
|
|
@ -169,8 +169,8 @@ void QDirectFbInput::handleMouseEvents(const DFBEvent &event)
|
|||
|
||||
void QDirectFbInput::handleWheelEvent(const DFBEvent &event)
|
||||
{
|
||||
QPoint p(event.window.cx, event.window.cy);
|
||||
QPoint globalPos = globalPoint(event);
|
||||
QPoint p(event.window.x, event.window.y);
|
||||
QPoint globalPos(event.window.cx, event.window.cy);
|
||||
long timestamp = (event.window.timestamp.tv_sec*1000) + (event.window.timestamp.tv_usec/1000);
|
||||
QWindow *tlw = m_tlwMap.value(event.window.window_id);
|
||||
QWindowSystemInterface::handleWheelEvent(tlw, timestamp, p, globalPos,
|
||||
|
|
@ -227,13 +227,4 @@ void QDirectFbInput::handleGeometryEvent(const DFBEvent &event)
|
|||
QWindowSystemInterface::handleGeometryChange(tlw, rect);
|
||||
}
|
||||
|
||||
inline QPoint QDirectFbInput::globalPoint(const DFBEvent &event) const
|
||||
{
|
||||
QDirectFBPointer<IDirectFBWindow> window;
|
||||
m_dfbDisplayLayer->GetWindow(m_dfbDisplayLayer, event.window.window_id, window.outPtr());
|
||||
int x,y;
|
||||
window->GetPosition(window.data(), &x, &y);
|
||||
return QPoint(event.window.cx +x, event.window.cy + y);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ private:
|
|||
void handleGotFocusEvent(const DFBEvent &event);
|
||||
void handleCloseEvent(const DFBEvent& event);
|
||||
void handleGeometryEvent(const DFBEvent& event);
|
||||
inline QPoint globalPoint(const DFBEvent &event) const;
|
||||
|
||||
|
||||
IDirectFB *m_dfbInterface;
|
||||
|
|
|
|||
Loading…
Reference in New Issue