summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorYikei Lu <luyikei.qmltu@gmail.com>2015-02-12 12:21:50 (GMT)
committerShawn Rutledge <shawn.rutledge@digia.com>2015-02-16 11:33:02 (GMT)
commit4c7565056f94814d857f210cbda04919a88adc62 (patch)
treef069d86b75506484cef24c6ddf7effc7f579cb01 /src/gui
parent2b7758a8763a8fe6ca13a2f04e0137df79c849d2 (diff)
downloadQt-4c7565056f94814d857f210cbda04919a88adc62.zip
Qt-4c7565056f94814d857f210cbda04919a88adc62.tar.gz
Qt-4c7565056f94814d857f210cbda04919a88adc62.tar.bz2
Fix Focus problem with QX11EmbedWidget
Since QX11EmbedWidget can be included in another Qt application which has QX11EmbedContainer, QX11EmbedWidget should be activated at first. Task-number: QTBUG-3617 Change-Id: I23e12f6c3ed9f7bd4a3ac0d0237bf7382db14ee2 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qx11embed_x11.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp
index 6d67691..f4def83 100644
--- a/src/gui/kernel/qx11embed_x11.cpp
+++ b/src/gui/kernel/qx11embed_x11.cpp
@@ -492,6 +492,9 @@ QX11EmbedWidget::QX11EmbedWidget(QWidget *parent)
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QApplication::instance()->installEventFilter(this);
+ // Focus itself at first.
+ qApp->setActiveWindow(this);
+
#ifdef QX11EMBED_DEBUG
qDebug() << "QX11EmbedWidget::QX11EmbedWidget: constructed client"
<< (void *)this << "with winId" << winId();