disable adjustment callbacks in index mode

Otherwise the document object gets updated with wrong position values,
because the adjustment belong to the index, not the document view.
This commit is contained in:
Abdo Roig-Maranges 2013-10-23 16:09:50 +02:00
parent 3634636227
commit 018e026e62

View file

@ -92,6 +92,11 @@ cb_view_hadjustment_value_changed(GtkAdjustment* adjustment, gpointer data)
return;
}
/* Do nothing in index mode */
if (girara_mode_get(zathura->ui.session) == zathura->modes.index) {
return;
}
update_visible_pages(zathura);
double position_x = zathura_adjustment_get_ratio(adjustment);
@ -113,6 +118,11 @@ cb_view_vadjustment_value_changed(GtkAdjustment* adjustment, gpointer data)
return;
}
/* Do nothing in index mode */
if (girara_mode_get(zathura->ui.session) == zathura->modes.index) {
return;
}
update_visible_pages(zathura);
double position_x = zathura_document_get_position_x(zathura->document);
@ -135,6 +145,11 @@ cb_view_hadjustment_changed(GtkAdjustment* adjustment, gpointer data)
zathura_adjust_mode_t adjust_mode =
zathura_document_get_adjust_mode(zathura->document);
/* Do nothing in index mode */
if (girara_mode_get(zathura->ui.session) == zathura->modes.index) {
return;
}
/* Don't scroll we're focusing the inputbar. */
if (adjust_mode == ZATHURA_ADJUST_INPUTBAR) {
return;
@ -158,6 +173,11 @@ cb_view_vadjustment_changed(GtkAdjustment* adjustment, gpointer data)
zathura_adjust_mode_t adjust_mode =
zathura_document_get_adjust_mode(zathura->document);
/* Do nothing in index mode */
if (girara_mode_get(zathura->ui.session) == zathura->modes.index) {
return;
}
/* Don't scroll we're focusing the inputbar. */
if (adjust_mode == ZATHURA_ADJUST_INPUTBAR) {
return;