mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:36:00 +01:00
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:
parent
018e026e62
commit
1171bffb6b
3 changed files with 8 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue