diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-10-14 10:35:44 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-14 19:42:17 +0200 |
commit | be1e6d17b919ea89c02bf37a12465c8d27f1380b (patch) | |
tree | 15782bde92a916b87e4a3ecc45888b167ec60152 | |
parent | cfb2f5fdd1e358a855dd2dfca82390bf02079528 (diff) |
Make the window active in eglfs and minimal plaform plugins.
Without a call to QWindowSystemInterface::handleWindowActivated() or
QPlatformWindow::requestWindowActivated() QGuiApplication's
activeWindow() and focusWindow() will return 0 all the time, and this
breaks key event delivery when key events are received not from a
windowing system but directly from e.g. evdev. In such cases the only
choice is to send the event to the active window but if there isn't
one the event will be lost.
These platforms will have one fullscreen window at a time so marking
it the active one should be a safe assumption.
Change-Id: Ia6f0e9f021fbd61bbd368ddc46f8a13fccda1c2f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/minimal/qminimalintegration.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 3d3e05d351..57579e8fef 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -81,7 +81,9 @@ QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const #ifdef QEGL_EXTRA_DEBUG qWarning("QEglIntegration::createPlatformWindow %p\n",window); #endif - return new QEglFSWindow(window); + QPlatformWindow *w = new QEglFSWindow(window); + w->requestActivateWindow(); + return w; } diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp index 2f2da6967a..7d882caecf 100644 --- a/src/plugins/platforms/minimal/qminimalintegration.cpp +++ b/src/plugins/platforms/minimal/qminimalintegration.cpp @@ -81,7 +81,9 @@ bool QMinimalIntegration::hasCapability(QPlatformIntegration::Capability cap) co QPlatformWindow *QMinimalIntegration::createPlatformWindow(QWindow *window) const { Q_UNUSED(window); - return new QPlatformWindow(window); + QPlatformWindow *w = new QPlatformWindow(window); + w->requestActivateWindow(); + return w; } QPlatformBackingStore *QMinimalIntegration::createPlatformBackingStore(QWindow *window) const |