]> git.lyx.org Git - lyx.git/commitdiff
#12423 fix a focus change problem
authorStephan Witt <switt@lyx.org>
Sun, 9 Jan 2022 21:33:43 +0000 (22:33 +0100)
committerStephan Witt <switt@lyx.org>
Sun, 9 Jan 2022 21:33:43 +0000 (22:33 +0100)
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.

src/frontends/qt/GuiSearch.cpp

index e387ce8ee65ec9ea2560b23f10e6c4fe7dc5cc9d..f12d42c11d42f155ee08a3d55f9ee4b24b27893e 100644 (file)
@@ -649,9 +649,10 @@ void GuiSearch::updateTitle()
                // remove title bar
                setTitleBarWidget(new QWidget());
                titleBarWidget()->hide();
-       } else
+       } else if (titleBarWidget()) {
                // restore title bar
                setTitleBarWidget(nullptr);
+       }
 }