The page widget shouldn't have to care what should be done with selected images
and text.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This patch adds a new configuration setting, selection-clipboard, which allows
us to choose between the PRIMARY selection, and the CLIPBOARD selection, for
determining which X clipboard to use for storing mouse-selected data. It has
only two valid values: "primary" and "clipboard", with "clipboard" being set as
the it's default value.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
ZathuraRenderer is a thread pool rendering the pages. Every page widget holds a
ZathuraRenderRequest instance to request its page to be rendered. This object
can also be used to abort the request in case the page is not visible anymore.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Hiding the inputbar immediately before jumping breaks incremental search, as
Guillaume Duranceau stated in an earlier mail.
This patch makes an exception for the case of incremental search, at the cost
of a slight displacement when jumping back (^o) after ending the incremental
search (pressing the ESC key). The rest of the jump cases are unaffected.
This should makes things usable for now, until we move to GTK3 (link to it by
default) which has a new widget that suits this problem nicely (GtkOverlay), as
demonstrated by an earlier patch by Abdo Roig-Maranges which is now included on
the develop branch in girara repo as commit
70fd1cf354ee1300d4a9bdab9e939d5cc975979e, but is compiled only with GTK3.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Otherwise, when opening a document at page 1, and no jumps are added,
bisect does not understand it has to initialize the bisect range, and
does not move from page 1.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
After page_set cb_view_hadjustment_changed must be called so that when
zoom-center is enabled, the page is recentered.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This patch implements two new ZathuraDatabaseInterface functions, save_jumplist
and load_jumplist, for both the plain and sqlite backends (along with some
cleanups).
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Since we are now saving the adjustments ratios in the jump structures, we need
to take care of the following scenario:
- We do an action that results in a new jump structure being added to the
jumplist while the inputbar is visible (e.g., search, jumping to a
specific page, jumping to a bookmark, or following a link).
- Since we are now storing the adjustments ratios in the jump structures,
all of the above actions would result in the vertical adjustment ratio
being saved while the inputbar and/or the completion menu is visible.
- Now we are exactly on the target of the jump (note that the inputbar and
completion menu now are hidden), so suppose that we want to go back using
^o (assuming that we didn't change the adjustments after jumping), then
the check at sc_jumplist that compares the current adjustments ratios
with that of the current jump (the jump that has just been added and
which we are currently on it's position) would fail, because after the
inputbar (with possibly the completion menu in case of bookmarks) is
activated it is hidden, which results in the vertical adjustment upper
bound to change, which in turn results in the vertical adjustment ratio
returned by zathura_adjustment_get_ratio to become different from what is
stored in the current jump structure, even though we haven't changed the
adjustments at all after the jump. This would always result in taking us
back to the exact position of the jump (which would be slightly different
from the current position) when we press ^o. This can be annoying,
because it would happen, for example, every time we need to go back
quickly after jumping to a link target, a search result, or a bookmark.
So, what this patch does is essentially to make the vertical adjustment ratio
reflecting the current vertical adjustment after a jump, to always be the same
as the one stored in the newly added jump structure, since both are calculated
with zathura_adjustment_get_ratio while the inputbar is _not_ visible, so they
should be the same.
I've elaborated just to make things clear, in case the purpose of the patch
isn't obvious.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This is just in case that zathura_link_evaluate returns without evaluating the
link, which would result in a new jump being added for the current position,
but without adding a corresponding jump for the target position (actually a
second one would be added but the check in zathura_jumplist_add would prevent
it from being appended on the linked list since it's position would be the same
as the current one, because the link haven't been evaluated).
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Not that is really needed here since every argument is controlled by us. But
rather safe than sorry.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>