replace delayed versions of page_set and position_set

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 commit is contained in:
Abdo Roig-Maranges 2013-10-22 23:11:33 +02:00
parent 018e026e62
commit 1171bffb6b
3 changed files with 8 additions and 9 deletions

View File

@ -475,7 +475,7 @@ sc_rotate(girara_session_t* session, girara_argument_t* argument,
/* render all pages again */ /* render all pages again */
render_all(zathura); render_all(zathura);
page_set_delayed(zathura, page_number); page_set(zathura, page_number);
return false; return false;
} }
@ -1122,7 +1122,7 @@ sc_toggle_index(girara_session_t* session, girara_argument_t* UNUSED(argument),
girara_mode_set(zathura->ui.session, zathura->modes.normal); girara_mode_set(zathura->ui.session, zathura->modes.normal);
/* reset adjustment */ /* reset adjustment */
position_set_delayed(zathura, hvalue, vvalue); position_set(zathura, hvalue, vvalue);
} else { } else {
/* save adjustment */ /* save adjustment */
GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
@ -1220,7 +1220,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t*
/* reset scale */ /* reset scale */
zathura_document_set_scale(zathura->document, zoom); zathura_document_set_scale(zathura->document, zoom);
render_all(zathura); render_all(zathura);
page_set_delayed(zathura, zathura_document_get_current_page_number(zathura->document)); page_set(zathura, zathura_document_get_current_page_number(zathura->document));
/* setm ode */ /* setm ode */
girara_mode_set(session, zathura->modes.normal); girara_mode_set(session, zathura->modes.normal);
@ -1248,7 +1248,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t*
/* set full screen */ /* set full screen */
gtk_window_fullscreen(GTK_WINDOW(session->gtk.window)); gtk_window_fullscreen(GTK_WINDOW(session->gtk.window));
page_set_delayed(zathura, zathura_document_get_current_page_number(zathura->document)); page_set(zathura, zathura_document_get_current_page_number(zathura->document));
/* setm ode */ /* setm ode */
girara_mode_set(session, zathura->modes.fullscreen); girara_mode_set(session, zathura->modes.fullscreen);
@ -1325,6 +1325,7 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
} }
render_all(zathura); render_all(zathura);
page_set(zathura, zathura_document_get_current_page_number(zathura->document));
return false; return false;
} }

View File

@ -97,7 +97,7 @@ synctex_record_hits(zathura_t* zathura, int page_idx, girara_list_t* hits, bool
g_object_set(page_widget, "search-results", hits, NULL); g_object_set(page_widget, "search-results", hits, NULL);
if (first) { if (first) {
page_set_delayed(zathura, zathura_page_get_index(page)); page_set(zathura, zathura_page_get_index(page));
g_object_set(page_widget, "search-current", 0, NULL); g_object_set(page_widget, "search-current", 0, NULL);
} }
} }

View File

@ -816,11 +816,9 @@ document_open(zathura_t* zathura, const char* path, const char* password,
adjust_view(zathura); adjust_view(zathura);
/* set position */ /* set position */
page_set(zathura, zathura_document_get_current_page_number(document));
if (file_info.position_x != 0 || file_info.position_y != 0) { if (file_info.position_x != 0 || file_info.position_y != 0) {
position_set_delayed(zathura, file_info.position_x, file_info.position_y); position_set(zathura, file_info.position_x, file_info.position_y);
} else {
page_set_delayed(zathura, zathura_document_get_current_page_number(document));
cb_view_vadjustment_value_changed(NULL, zathura);
} }
return true; return true;