From: Stephan Witt Date: Sun, 9 Jan 2022 21:33:43 +0000 (+0100) Subject: #12423 fix a focus change problem X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=678ab325c0a38b475a60a9045691789d115b2491;p=features.git #12423 fix a focus change problem The search widget triggers a showEvent() in updateTitle() leading to setting the focus to the default push button. The check in updateTitle() for the need to restore the title avoids superfluous show events and avoids the unwanted focus change. --- diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp index e387ce8ee6..f12d42c11d 100644 --- a/src/frontends/qt/GuiSearch.cpp +++ b/src/frontends/qt/GuiSearch.cpp @@ -649,9 +649,10 @@ void GuiSearch::updateTitle() // remove title bar setTitleBarWidget(new QWidget()); titleBarWidget()->hide(); - } else + } else if (titleBarWidget()) { // restore title bar setTitleBarWidget(nullptr); + } }