From bb2ea689aba82cc3de1936b21e8af25cba0781d4 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 16 May 2012 10:29:04 +0200 Subject: directfb: Handle focus, close and geometry change events Report the focus, close and geometry to Qt. Change-Id: I059fef5aba5f0e5c0654ba11b0615bc0f5ac50aa Reviewed-by: Girish Ramakrishnan --- src/plugins/platforms/directfb/qdirectfbinput.cpp | 29 +++++++++++++++++++++++ src/plugins/platforms/directfb/qdirectfbinput.h | 3 +++ 2 files changed, 32 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/directfb/qdirectfbinput.cpp b/src/plugins/platforms/directfb/qdirectfbinput.cpp index d980f5453a..662493ff20 100644 --- a/src/plugins/platforms/directfb/qdirectfbinput.cpp +++ b/src/plugins/platforms/directfb/qdirectfbinput.cpp @@ -131,6 +131,16 @@ void QDirectFbInput::handleEvents() case DWET_ENTER: case DWET_LEAVE: handleEnterLeaveEvents(event); + break; + case DWET_GOTFOCUS: + handleGotFocusEvent(event); + break; + case DWET_CLOSE: + handleCloseEvent(event); + break; + case DWET_POSITION_SIZE: + handleGeometryEvent(event); + break; default: break; } @@ -198,6 +208,25 @@ void QDirectFbInput::handleEnterLeaveEvents(const DFBEvent &event) } } +void QDirectFbInput::handleGotFocusEvent(const DFBEvent &event) +{ + QWindow *tlw = m_tlwMap.value(event.window.window_id); + QWindowSystemInterface::handleWindowActivated(tlw); +} + +void QDirectFbInput::handleCloseEvent(const DFBEvent &event) +{ + QWindow *tlw = m_tlwMap.value(event.window.window_id); + QWindowSystemInterface::handleCloseEvent(tlw); +} + +void QDirectFbInput::handleGeometryEvent(const DFBEvent &event) +{ + QWindow *tlw = m_tlwMap.value(event.window.window_id); + QRect rect(event.window.x, event.window.y, event.window.w, event.window.h); + QWindowSystemInterface::handleGeometryChange(tlw, rect); +} + inline QPoint QDirectFbInput::globalPoint(const DFBEvent &event) const { QDirectFBPointer window; diff --git a/src/plugins/platforms/directfb/qdirectfbinput.h b/src/plugins/platforms/directfb/qdirectfbinput.h index 12e596d50b..aa58b92548 100644 --- a/src/plugins/platforms/directfb/qdirectfbinput.h +++ b/src/plugins/platforms/directfb/qdirectfbinput.h @@ -72,6 +72,9 @@ private: void handleWheelEvent(const DFBEvent &event); void handleKeyEvents(const DFBEvent &event); void handleEnterLeaveEvents(const DFBEvent &event); + void handleGotFocusEvent(const DFBEvent &event); + void handleCloseEvent(const DFBEvent& event); + void handleGeometryEvent(const DFBEvent& event); inline QPoint globalPoint(const DFBEvent &event) const; -- cgit v1.2.3