directfb: Handle focus, close and geometry change events
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>
Wed, 16 May 2012 08:29:04 +0000 (10:29 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 22 May 2012 03:09:07 +0000 (05:09 +0200)
Report the focus, close and geometry to Qt.

Change-Id: I059fef5aba5f0e5c0654ba11b0615bc0f5ac50aa
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
src/plugins/platforms/directfb/qdirectfbinput.cpp
src/plugins/platforms/directfb/qdirectfbinput.h

index d980f54..662493f 100644 (file)
@@ -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<IDirectFBWindow> window;
index 12e596d..aa58b92 100644 (file)
@@ -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;