From 09c17cc135df67749e6e28c09a2620f4ef87b0d7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Feb 2024 13:48:14 +0530 Subject: [PATCH] Fix #2054935 [[Enhancement] Switch focus to main calibre window when clicking Jump to this book in the library in the Full text search window](https://bugs.launchpad.net/calibre/+bug/2054935) --- src/calibre/gui2/fts/search.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/fts/search.py b/src/calibre/gui2/fts/search.py index 259f48b93f..cfe4407480 100644 --- a/src/calibre/gui2/fts/search.py +++ b/src/calibre/gui2/fts/search.py @@ -46,7 +46,9 @@ def jump_to_book(book_id, parent=None): gui = get_gui() if gui is not None: parent = parent or gui - if not gui.library_view.select_rows((book_id,)): + if gui.library_view.select_rows((book_id,)): + gui.raise_and_focus() + else: if gprefs['fts_library_restrict_books']: error_dialog(parent, _('Not found'), _('This book was not found in the calibre library'), show=True) else: