poppler_page_get_selection_region was deprecated in Poppler 0.16.
Instead, use poppler_page_get_selected_region. The changes in this
commit do not have any behavior change, but the use of the
non-deprecated function allows for some code simplification.
which was used in the EvView context menu, and
use instead 'highlight-text' action, which
provides the same functionality (highlighting
selected text) but with the added bonus of
showing the keybinding (Ctrl+H) in the context
menu.
In case the action was disabled for the context
menu we need to enable it back again when
closing the menu and returning to normal view,
we do that in the menu "hide" signal handler.
Closes#1919
Some MR may fail because the coding style of some files do not
follow minimal coding style, regardless whether those lines are
actually part of the MR itself.
Hence, let start with a lenient lint, and in the future re-assess
whether to keep it lenient or switching it strict failure.
It currently runs with checks for indentation disabled. The main reason
is that the code contains innumerable situations where spaces are used
for indentation instead of tabs. Fixing those require extensive manual
and repetitive labour. And having this is probably better than nothing.
Additionally, the cut-n-paste is also ignored, since otherwise it wouldn't
be "cut and paste".
This is an undocumented feature, since the ability to change shortcuts
was removed somewhere in GTK 3.10, according to the commit that
updated the documentation: 54f43719c6
The shortcuts documentation was later completely removed in
a050ee73d7 since the help-overlay in the
shell takes care of it.
Another reason to drop this is the lack of first-class support in
GTK4:
"There is no direct replacement for loading and saving accelerators
with GtkAccelMap. But since GtkShortcutController implements
GListModel and both GtkShortcutTrigger and GtkShortcutAction can be
serialized to strings, it is relatively easy to implement saving and
loading yourself."
So in GTK4 it's possible, but requires further development. Which is
likely of very little use for an undocumented feature introduced 15
years ago as a copy-paste in 83a7a11ba1
Relates !373
The migration code has been there since tag 2.91.1. Remove it to
generally simplify the ev-application.c code. If anybody is migration
from GNOME pre 3.0 to GNOME 44, it is likely that the evince config
dir is the least of their problems.
This partially reverts 82415a8523
There's nothing in the PDF backend making use of it. It is only used
in libdocument/ev-xmp.c, which is unconditionally added as part of
libdocument, so add the dependency as global instead
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.
This makes it possible to run changes in evince without actually
installing it, or without the system installation getting in the way
of the changes tested.
This was introduced in 768a559d41, 13
years ago and pre GNOME 3 times. We can probably safely consider that
migration an existing installation from those times to current is
unsupported. Whoever tries to do that, is probably going to bump into
many other issues than some config not being migrated in evince.
Introduced in 45467f0d8a and never
touched since, the icon is a way to embed the icon into the binary in
a windows-compliant way. At the time, there was code consuming the
ICON macro, like "cut-n-paste/smclient". That code does not exist
anymore and renders this file and the logic around it unnecessary.
Evince is one of GNOME's core apps. All of them have an explicit
requirement on GNOME systems icon theme, which is currently
libadwaita. That's by design. Let's not clutter the build
infrastructure for something that should be known
These do not really exist* in GTK3's code, and is probably some old
thing coming from GTK2 times. I went back as far as
31e16bd8f3 and still could not find
where were they introduced. Since they have no use, remove them.
* There is actually one #ifndef GDK_MULTIHEAD_SAFE in the
GtkIconFactory code, but that's only adding one function to the
API. And the GtkIconFactory code has to disappear from Evince. So that
should not be an issue.
It may happen that a text match has no corresponding text area available,
(due to limitations/bugs of Poppler's TextPage->getSelectionWords()
function used by poppler-glib poppler_page_get_text_layout_for_area()
function) so in that case, instead of discarding the match, we can
just show the matched text in the sidebar without surrounding text,
because the text area is only needed to retrieve surrounding text.
Closes#1943
At least 4 different bugs were filed against the Flathub version of
evince because Flatpak prominently shows the appdata version in the UI,
making users think that there was a bug in the packaging, or that the
package had not been updated.
Avoid this problem in the future by failing the build if the NEWS or
appdata files aren't updated on release.
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;
| ^~~
}
}
The popup is now associated with a menu and can be created at init.
Creating the popup only on first use might save some very little memory,
but complicates the logic.
There is no need to re-check for "priv->metadata" when it just
got assigned. And if "priv->metadata" does not exist, neither does
"priv->bookmarks" that is cleared at the same time
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
Fix crash when instantiating 'evince-toolbar.ui' template
because Evince custom types used in that template were still
unregistered in GTK type system.
Register them with g_type_ensure() just before instantiating
the .ui template with gtk_widget_init_template()
Closes#1930