[LyX/master] #12423 fix a focus change problem

Stephan Witt switt at lyx.org
Sun Jan 9 21:03:55 UTC 2022


commit 678ab325c0a38b475a60a9045691789d115b2491
Author: Stephan Witt <switt at lyx.org>
Date:   Sun Jan 9 22:33:43 2022 +0100

    #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.
---
 src/frontends/qt/GuiSearch.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp
index e387ce8..f12d42c 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);
+	}
 }
 
 


More information about the lyx-cvs mailing list