In the case we want to automatically set the position by by passing -1
to position_set, we better tell it the page before.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Hi,
It seems that pkg-config complains when using --atleast-version together with
--cflags or --libs. I attach a patch.
Abdó.
From d01e128e7b4c2decb4d3a05e23b9b12cfda62879 Mon Sep 17 00:00:00 2001
From: Abdo Roig-Maranges <abdo.roig@gmail.com>
Date: Sat, 26 Oct 2013 16:51:39 +0200
Subject: [PATCH] pkg-config complains about --atleast-version
pkg-config spits out
Ignoring incompatible output option "--atleast-version"
when using --atleast-version together with --cflags or --libs.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
We no longer need to hide the inputbar to get the right jump position,
since now showing or hiding the inputbar does not change the position
stored in the document object.
Wen the adjustments get resized, the changed_callback resets the value
from what is stored in the document object, effectively recentering the
position to the middle of the viewport.
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.
We now use the data available on the document object to compute the
exact positioning of the link target.
This way we get rid of page_calculate_offset, which uses explicit GTK
calls.
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!
The adjustment callbacks act as an interface between position data in
the document object, and the adjustments.
We remove the horizontal centering code, as now it is done by
position_set. Those callbacks should not change the position read from
the document object in any way.
Also, we split the adjustment_value_changed callback into a vertical and
an horizontal version. Previously a single callback was reused for both,
horizontal and vertical. That lead to a subtle problem when coming out
of index mode. What happened was the following:
1. horizontal adjustment bounds change coming out of index mode. This
triggers an hadjustment changed signal.
2. the hadjustment_changed callback handles it, and resets the
hadjustment value, as the bound may have changed. This triggers a
value_changed event.
3. the value_changed callback handles the event, and captures the
position for *BOTH*, horizontal and vertical adjustments, saving
them to the document object.
1..3 is repeated for the vertical adjustment.
Now, if in 3. the horizontal adjustment bounds were not yet updated
after the index mode, we got ourselves at the wrong vertical position.
This race condition is avoided now because both value_changed callbacks
*ONLY* handle their own direction, either vertical or horizontal, not
both.
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.
Now page_set and position_set save the computed page and position to the
document object, then trigger a refresh-view signal. They do not handle
GTK adjustments anymore.