Skip to content

Commit 4c75650

Browse files
luyikeiec1oud
authored andcommitted
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 <[email protected]>
1 parent 2b7758a commit 4c75650

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gui/kernel/qx11embed_x11.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ QX11EmbedWidget::QX11EmbedWidget(QWidget *parent)
492492
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
493493
QApplication::instance()->installEventFilter(this);
494494

495+
// Focus itself at first.
496+
qApp->setActiveWindow(this);
497+
495498
#ifdef QX11EMBED_DEBUG
496499
qDebug() << "QX11EmbedWidget::QX11EmbedWidget: constructed client"
497500
<< (void *)this << "with winId" << winId();

0 commit comments

Comments
 (0)