From f72ecb6a0ee6586965cd69fff80ff571e6dbbb31 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 Mar 2022 21:48:59 +0530 Subject: [PATCH] Fix automatic searches causing search box to lose focus when search as you type is enabled in Preferences->Searching. Fixes #1963868 [Focus stolen from search bar after several seconds leads to misclicks](https://bugs.launchpad.net/calibre/+bug/1963868) --- src/calibre/gui2/search_box.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index 0150def30b..f2739a57af 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -244,6 +244,8 @@ class SearchBox2(QComboBox): # {{{ def timer_event(self): self._do_search(as_you_type=True) + # since this is an automatic search keep focus + self.setFocus(Qt.FocusReason.OtherFocusReason) def history_selected(self, text): self.changed.emit()