diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.cpp b/src/plugins/platforms/directfb/qdirectfbwindow.cpp index 2d6bee5ba7..0d32596631 100644 --- a/src/plugins/platforms/directfb/qdirectfbwindow.cpp +++ b/src/plugins/platforms/directfb/qdirectfbwindow.cpp @@ -169,3 +169,27 @@ WId QDirectFbWindow::winId() const m_dfbWindow->GetID(m_dfbWindow.data(), &id); return WId(id); } + +bool QDirectFbWindow::setKeyboardGrabEnabled(bool grab) +{ + DFBResult res; + + if (grab) + res = m_dfbWindow->GrabKeyboard(m_dfbWindow.data()); + else + res = m_dfbWindow->UngrabKeyboard(m_dfbWindow.data()); + + return res == DFB_OK; +} + +bool QDirectFbWindow::setMouseGrabEnabled(bool grab) +{ + DFBResult res; + + if (grab) + res = m_dfbWindow->GrabPointer(m_dfbWindow.data()); + else + res = m_dfbWindow->UngrabPointer(m_dfbWindow.data()); + + return res == DFB_OK; +} diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.h b/src/plugins/platforms/directfb/qdirectfbwindow.h index 77afda5246..1169b8bf27 100644 --- a/src/plugins/platforms/directfb/qdirectfbwindow.h +++ b/src/plugins/platforms/directfb/qdirectfbwindow.h @@ -61,6 +61,8 @@ public: void setVisible(bool visible); Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); + bool setKeyboardGrabEnabled(bool grab); + bool setMouseGrabEnabled(bool grab); void raise(); void lower(); WId winId() const;