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)

This commit is contained in:
Kovid Goyal 2022-03-16 21:48:59 +05:30
parent 6cfeec7245
commit f72ecb6a0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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()