Commit 018e026e authored by Abdo Roig-Maranges's avatar Abdo Roig-Maranges
Browse files

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.
parent 36346362
......@@ -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;
......
Supports Markdown
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