Under Wayland, when closing an Evince annotation window
directly from the desktop compositor e.g. gnome-shell
then Evince would crash when trying to draw the window
as it haven't noticed it has gone.
Fixed by listening to "delete-event" signal so Evince
notices the closing and acts accordingly.
Fixes#2009
Fix transformation of view coordinates to Evince's
document coordinates for rotated pages.
This fixes placing of annotations on rotated pages.
Fixes#1951
Together with changes to meson, it allows to have icons while doing
"meson devenv". Icons are expected under the "hicolor" location, so
create a link that points there.
Silence the following warnings, since the compiler does not have the
warranty that start and end might have been set inside get_selection_bounds
../libview/ev-page-accessible.c: In function 'ev_page_accessible_get_selection':
../libview/ev-page-accessible.c:731:74: warning: 'start' may be used uninitialized [-Wmaybe-uninitialized]
731 | if (get_selection_bounds (view, selection, &start, &end) && start != end) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
../libview/ev-page-accessible.c:726:22: note: 'start' was declared here
726 | gint start, end;
| ^~~~~
../libview/ev-page-accessible.c:731:74: warning: 'end' may be used uninitialized [-Wmaybe-uninitialized]
731 | if (get_selection_bounds (view, selection, &start, &end) && start != end) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
../libview/ev-page-accessible.c:726:29: note: 'end' was declared here
726 | gint start, end;
| ^~~
}
}
Small oversight from the refactor in commit 33b251b6
which removed the "set to null" but forgot to
change the g_object_unref() for the g_clear_object()
call.
Bisected by Germán Poo-Caamaño.
Closes#1933
ev_presentation_delete_job already checks whether the job is NULL,
and finishes with a g_object_unref which warranties that
pview->*_job = NULL
So there's no need to set them afterwards.
This was introduced in 17859243df with
the rationale:
Even if we now render a background in _draw() with
gtk_render_background, using gtk_style_context_set_background() in
realize makes the backing GdkWindow not being completely transparent,
which enables GTK to apply optimizations during the paint cycle.
The result is, especially in clutter-gtk applications such as Documents,
scrolling in a document page is much smoother.
https://bugzilla.gnome.org/show_bug.cgi?id=692988
Clutter was completely archived in GNOME 42 https://blogs.gnome.org/clutter/
so the rationale does no longer hold. Since the call is deprecated, just
remove it, as it is unncessary.
When SCROLLING_TO_PAGE in a continuous view with
a FIT_PAGE sizing mode, let's center the page a
bit better so the next page is not visible.
Fixes#1868Fixes#1905
Evince currently fails an annotation assertion and crashes if the user selects text,
and while holding, press 's' and release the click.
This is because pressing 's' sets adding_annot to true. In the button release event handler,
if its true then we proceed to save the annotation to the document. However,
this release event corresponds to text selection, so in the button press handler we have not
populated view->adding_annot_info.annot, resulting in a failed assertion in the release handler.
To fix this, add a condition to check if we are just coming out of text selection before
doing annotation saving related logic.
Fixes https://gitlab.gnome.org/GNOME/evince/-/issues/1861
Wait for all jobs before exiting main().
This allows clean execution of exit handlers.
Otherwise, the threads which executes the jobs could
access data already cleaned by exit handlers.
Fixes#1713
Annotations may come with a NULL color, use
a default color there instead of letting
undefined GdkRGBA to crash the application.
We take the chance to share this default color
to be the same we already use when creating
an annotation from Evince.
We also take the chance to replace deprecated
function ev_annotation_set_color() with
ev_annotation_set_rgba()
Fixes crash in #1800
which is available in Poppler since version 21.03.0
For that we create a new EvFindRectangle type to hold more match
information apart from coordinates, and use it all across Evince
including pdf backend (ev-poppler.cc) and djvu backend (djvu-document.c)
which are the only backends implementing the EvDocumentFindInterface.
To not break API compatibility, we added a new EvDocumentFindInterface
function which returns GList of this new EvFindRectangle type:
GList *(* find_text_extended) (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
EvFindOptions options);
and changed Evince to use this new function instead of find_text_with_options().
Some info about how this new search feature works:
- Ignores hyphen character while matching when:
1) it's the last character of the line.
2) its corresponding matching character in the search term
is not an hyphen too.
- Any whitespace characters in the search term will be allowed
to match on the logic position where the lines split (i.e. what
would normally be the newline character in a text file, but
PDF text does not include newline characters between lines).
- It won't match on text spanning more than two lines, i.e. it
only matches text spanning from end of one line to start of
next line.
Part of issue #333
Issue #1333 removed Evince ability to run any command
from pdf 'launch action', while the security concerns
brought up in #1333 were valid, the measure implemented
was maybe too drastic, as there are valid use cases
where launching a pdf is needed.
For instance, the cases described in issue #48, one of
them is the document 'Nissan Patrol Maintenance Manual'
which is comprised of several pdf files, where there is
one acting as index for the others, this index pdf file
uses the launch action to open the other pdf's.
So this commit allows to launch a file from a link
action only when:
- that file is a pdf file.
- the launch action originates from click event,
to be sure the user requested the action.
Besides, we don't just let the system execute the
file, but because it's a pdf we do it ourselves by
launching a new evince instance (or if that file was
already opened then presenting its window).
Fixes issue #48
EvView have signals 'annot-added', 'annot-removed', 'annot-changed'
which EvWindow connects to update the window widgets accordingly.
When cancelling an ongoing add-annotation operation through eg.
not highlighting any text when adding a markup annotation, we
don't have any corresponding signal to let EvWindow know of this
cancel (as 'annot-added' is only for when it's created
succesfully).
So we add a new EvView 'annot-cancel-add' signal which is
emitted for this case and that EvWindow can respond to it
by updating the ui accordingly i.e. unpressing button in
EvAnnotationsToolbar.
Fixes part of #1730
to avoid unwanted previews showing up in any of these
situations:
- when scrolling the view
- when pressing PageUp/PageDown or NextPage/PrevPage keys
- when changing to a page by clicking a bookmark or outline entry
we make sure to only show them when moving the mouse over them
(motion events).
Fixes issue #1666
Make EvPrintOperationExport an abstract base class, and move the
unix printing specific code to a new EvPrintOperationExportUnix.
This is in preparation to creating a EvPrintOperationExportPortal
which implements the export operation via Portal.
By right clicking an annotation and selecting "Annotation Properties...",
there exists an option called "Initial window state" which regulates
whether the annotation window should be opened when opening the document.
This behavior was altered by commit aed1af6fa7,
whose purpose was exactly to prevent annotation windows from opening
for performance reasons.
Fixes: https://gitlab.gnome.org/GNOME/evince/-/issues/1425
Fail the render job if the surface is in error state. This prevents
the failure of the render job leaking out to failing to render the
evince UI.
Based on a patch by Marek Kasik <mkasik@redhat.com>.
Use the newly added EV_PUBLIC macro to explicitly mark symbols to be
exported, instead of exporting everything starting with "ev_".
This removes lots of accidentally exposed, private functions. Since
those are not contained in public installed headers, this should be ok.