static void
view_update_range_and_current_page (EvView *view)
{
+ if (view->pending_scroll != SCROLL_TO_KEEP_POSITION)
+ return;
+
/* Presentation trumps all other modes */
if (view->presentation) {
view->start_page = view->current_page;
gint max_width;
gint x, y;
- ev_page_cache_get_max_width (view->page_cache, view->scale,
- view->rotation, &max_width);
+ ev_page_cache_get_max_width (view->page_cache, view->rotation,
+ view->scale, &max_width);
max_width = max_width + border->left + border->right;
/* Get the location of the bounding box */
if (view->dual_page) {
return FALSE;
}
+static gint
+ev_view_focus_in (GtkWidget *widget,
+ GdkEventFocus *event)
+{
+ if (EV_VIEW (widget)->pixbuf_cache)
+ ev_pixbuf_cache_style_changed (EV_VIEW (widget)->pixbuf_cache);
+ gtk_widget_queue_draw (widget);
+
+ return FALSE;
+}
+
+static gint
+ev_view_focus_out (GtkWidget *widget,
+ GdkEventFocus *event)
+{
+ if (EV_VIEW (widget)->pixbuf_cache)
+ ev_pixbuf_cache_style_changed (EV_VIEW (widget)->pixbuf_cache);
+ gtk_widget_queue_draw (widget);
+
+ return FALSE;
+}
+
static gboolean
ev_view_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event)
{
widget_class->button_press_event = ev_view_button_press_event;
widget_class->motion_notify_event = ev_view_motion_notify_event;
widget_class->button_release_event = ev_view_button_release_event;
+ widget_class->focus_in_event = ev_view_focus_in;
+ widget_class->focus_out_event = ev_view_focus_out;
widget_class->size_request = ev_view_size_request;
widget_class->size_allocate = ev_view_size_allocate;
widget_class->realize = ev_view_realize;
EvViewSelection *selection;
ev_page_cache_get_size (view->page_cache,
+ i,
view->rotation,
- i, 1.0, &width, &height);
+ 1.0, &width, &height);
selection = g_new0 (EvViewSelection, 1);
selection->page = i;