Skip to content

Commit

Permalink
should focus window even open the same file
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjiaodawang committed Oct 9, 2024
1 parent b5c2654 commit 1202656
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pdf_viewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ MainWidget* handle_args(const QStringList& arguments, QLocalSocket* origin=nullp
target_window->push_state();
target_window->open_document_at_location(pdf_file_name, page.value_or(0), x_loc, y_loc, zoom_level);
}
focus_on_widget(target_window);
}
else if (latex_file_name) {
if (target_window) {
Expand All @@ -619,6 +620,7 @@ MainWidget* handle_args(const QStringList& arguments, QLocalSocket* origin=nullp
target_window->push_state();
target_window->open_document(pdf_file_name);
}
focus_on_widget(target_window);
}

invalidate_render();
Expand Down
1 change: 0 additions & 1 deletion pdf_viewer/main_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,6 @@ void MainWidget::open_document(const Path& path, std::optional<float> offset_x,
}
update_scrollbar();
}
focus_on_widget(this);

deselect_document_indices();
invalidate_render();
Expand Down

0 comments on commit 1202656

Please sign in to comment.