Commit 1171bffb authored by Abdo Roig-Maranges's avatar Abdo Roig-Maranges

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!
parent 018e026e
......@@ -475,7 +475,7 @@ sc_rotate(girara_session_t* session, girara_argument_t* argument,
/* render all pages again */
render_all(zathura);
page_set_delayed(zathura, page_number);
page_set(zathura, page_number);
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);
/* reset adjustment */
position_set_delayed(zathura, hvalue, vvalue);
position_set(zathura, hvalue, vvalue);
} else {
/* save adjustment */
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 */
zathura_document_set_scale(zathura->document, zoom);
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 */
girara_mode_set(session, zathura->modes.normal);
......@@ -1248,7 +1248,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t*
/* set full screen */
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 */
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);
page_set(zathura, zathura_document_get_current_page_number(zathura->document));
return false;
}
......@@ -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);
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);
}
}
......
......@@ -816,11 +816,9 @@ document_open(zathura_t* zathura, const char* path, const char* password,
adjust_view(zathura);
/* set position */
page_set(zathura, zathura_document_get_current_page_number(document));
if (file_info.position_x != 0 || file_info.position_y != 0) {
position_set_delayed(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);
position_set(zathura, file_info.position_x, file_info.position_y);
}
return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment