]> git.lyx.org Git - lyx.git/commitdiff
GuiSearch: prevent Tab key to switch to work area (part of #12170)
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 6 May 2021 10:27:38 +0000 (12:27 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 6 May 2021 10:27:38 +0000 (12:27 +0200)
QWidget::focusNextPrevChild() passes over to the parent (which is the
work area here) if the current window is not a dialog (isWindow()) or
a sub-window (window flag Qt::SubWindow).

We set the latter here to prevent this unwanted behavior.

Let's see if there are side-effects.

src/frontends/qt/GuiSearch.cpp

index 32a8fd15d60498b540feb0f4bb30052dd31dee84..9212ddd30c528c2e6fbbbc854cb4e53735bd0c64 100644 (file)
@@ -126,6 +126,10 @@ GuiSearchWidget::GuiSearchWidget(QWidget * parent)
        replacePB->setEnabled(false);
        replacePrevPB->setEnabled(false);
        replaceallPB->setEnabled(false);
+
+       // Make this a sub window to prevent focusNextPrevChild (Tab)
+       // switching to the parent (#12170)
+       setWindowFlags(Qt::SubWindow);
 }