Skip to content

Commit

Permalink
pdf: Use poppler_annot_markup_set_popup_rectangle() if available
Browse files Browse the repository at this point in the history
This way we don't create a new popup annotation every time we save the
window position.
  • Loading branch information
Carlos Garcia Campos committed Apr 18, 2015
1 parent 0bf74fc commit 4991262
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/pdf/ev-poppler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3358,7 +3358,14 @@ pdf_document_annotations_save_annotation (EvDocumentAnnotations *document_annota
poppler_rect.y1 = height - ev_rect.y2;
poppler_rect.y2 = height - ev_rect.y1;

poppler_annot_markup_set_popup (markup, &poppler_rect);
if (poppler_annot_markup_has_popup (markup))
#ifdef HAVE_POPPLER_ANNOT_MARKUP_SET_POPUP_RECTANGLE
poppler_annot_markup_set_popup_rectangle (markup, &poppler_rect);
#else
poppler_annot_markup_set_popup (markup, &poppler_rect);
#endif
else
poppler_annot_markup_set_popup (markup, &poppler_rect);
}
if (mask & EV_ANNOTATIONS_SAVE_POPUP_IS_OPEN)
poppler_annot_markup_set_popup_is_open (markup, ev_annotation_markup_get_popup_is_open (ev_markup));
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ if test "x$enable_pdf" = "xyes"; then
if test x$enable_cairo_ps = xyes; then
AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
fi

evince_save_LIBS=$LIBS
LIBS="$LIBS $POPPLER_LIBS"
AC_CHECK_FUNCS(poppler_annot_markup_set_popup_rectangle)
LIBS=$evince_save_LIBS
else
AC_MSG_ERROR("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
fi
Expand Down

0 comments on commit 4991262

Please sign in to comment.