Align center of the rectangle with the center of the viewport, vor both
keyword searches and synctex forward search.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This way we get rid of page_calculate_offset that involves explicit GTK
calls. Also, we can make use of page_number_to_position to align page
and viewport as desired.
I've also tried to make the code for this function a bit more readable.
The new page_set and position_set behave as delayed, but with the
immediate availability of the new positions through the document
object. We no longer need to keep delayed and non-delayed versions!
This new function adjust_view is in charge of recomputing the scale
according to adjustment settings and trigger a render_all.
adjust_view contains the old sc_adjust_window code, slightly simplified
thanks to the availability of the document_get_viewport_size.
Then it is used by sc_adjust_window, document_open and the
cb_view_resized callback. Makes slightly more sense this way than
calling the shortcut sc_adjust_window directly.
Since we 'continue' the loop if num_search_results is 0, there is no need for
the second check.
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>
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>
- Allow the user to always start with the very last (or first) jump on the
jumplist when pressing ^o (or ^i), while the jumplist iterator is
pointing to the last (or first) jump, and the document is not currently
at the position of this pointed-to jump. This is instead of jumping
directly to the previous/next jump, and skipping the last/first one.
- Don't jump to the current jump pointed to by the jumplist iterator, if
there is no more next jumps, and the jump direction is FORWARD.
- Don't jump to the current jump pointed to by the jumplist iterator, if
there is no more previous jumps, and the jump direction is BACKWARD.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>