Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1144, focus window on macOS #1183

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions pdf_viewer/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ int argminf(const std::vector<T>& collection, std::function<float(T)> f) {
}
return min_index;
}

void focus_on_widget(QWidget* widget);
void rect_to_quad(fz_rect rect, float quad[8]);
void copy_to_clipboard(const std::wstring& text, bool selection = false);
void install_app(const char* argv0);
Expand Down
Loading