aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r--src/mainwindow/mainwindow.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index f83c2a7..eba02c6 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -84,7 +84,17 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent)
auto *searchShortcut = new QShortcut(QKeySequence(config->value<std::string>("mainwindow.shortcuts.search").value().c_str()), this);
connect(searchShortcut, &QShortcut::activated, this, [=]() {
- searchBox->setVisible(!searchBox->isVisible());
+ /* QTBUG-18665
+ * When focusing out of the search box and hiding it, the first
+ * (or earlier?) subwindow gets activated for some reason.
+ */
+ if(searchBox->isVisible()) {
+ auto *w = mdiArea->currentSubWindow();
+ searchBox->hide();
+ mdiArea->setActiveSubWindow(w);
+ } else {
+ searchBox->show();
+ }
});
}