diff options
author | Liang Qi <liang.qi@qt.io> | 2016-12-16 09:38:46 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-12-16 09:45:16 +0100 |
commit | 9bfe3ab71e5291445e66be96d6cd1f63934a2d83 (patch) | |
tree | a3b5580d8788de658f39d5bdb23d84a447999bee /src/plugins/platforms/winrt/qwinrtwindow.cpp | |
parent | 28dffdecdad4f3458b9aacec1a04803c7b5483a1 (diff) | |
parent | 179045f36a16ce2f6cfaad1dbd9443b52b1bf8d3 (diff) |
Merge remote-tracking branch 'origin/5.8.0' into 5.8
Conflicts:
doc/global/qt-cpp-defines.qdocconf
src/plugins/platforms/android/qandroidplatformopenglcontext.h
src/plugins/platforms/android/qandroidplatformtheme.h
Change-Id: I13d51cc66f708138ff4d667ceea7d515992e58a4
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrtwindow.cpp')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtwindow.cpp | 23 |
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); |