summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt/qwinrtwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrtwindow.cpp')
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp
index 297e6618d1..8f3b86ff3b 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.cpp
+++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp
@@ -191,6 +191,11 @@ QWinRTWindow::~QWinRTWindow()
});
RETURN_VOID_IF_FAILED("Failed to completely destroy window resources, likely because the application is shutting down");
+ if (d->screen->mouseGrabWindow() == this)
+ d->screen->setMouseGrabWindow(this, false);
+ if (d->screen->keyboardGrabWindow() == this)
+ d->screen->setKeyboardGrabWindow(this, false);
+
d->screen->removeWindow(window());
if (!d->surface)
@@ -384,6 +389,24 @@ void QWinRTWindow::setWindowState(Qt::WindowState state)
d->state = state;
}
+bool QWinRTWindow::setMouseGrabEnabled(bool grab)
+{
+ Q_D(QWinRTWindow);
+ if (!isActive() && grab) {
+ qWarning("%s: Not setting mouse grab for invisible window %s/'%s'",
+ __FUNCTION__, window()->metaObject()->className(),
+ qPrintable(window()->objectName()));
+ return false;
+ }
+ return d->screen->setMouseGrabWindow(this, grab);
+}
+
+bool QWinRTWindow::setKeyboardGrabEnabled(bool grab)
+{
+ Q_D(QWinRTWindow);
+ return d->screen->setKeyboardGrabWindow(this, grab);
+}
+
EGLSurface QWinRTWindow::eglSurface() const
{
Q_D(const QWinRTWindow);