Skip to content

Commit

Permalink
fix #1144, focus window on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjiaodawang committed Oct 9, 2024
1 parent dac86a4 commit b5c2654
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pdf_viewer/main_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,7 @@ 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
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

0 comments on commit b5c2654

Please sign in to comment.