summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2021-05-26 21:42:46 +0200
committerMilan Crha <mcrha@redhat.com>2021-05-26 21:45:44 +0200
commit498c0f8f1f7eaa9422e015e43e4d9c0f3dcd26e2 (patch)
tree0e3657622f700b69af1b28f9fbf76bf4b836adb5
parentc7f0034eeda7f0c5cc1c8b8f57774ab5568364da (diff)
downloadevolution-498c0f8f1f7eaa9422e015e43e4d9c0f3dcd26e2.tar.gz
ETable: Sometimes does not scroll to the cursor row
It could sometimes happen that the request to scroll to the cursor had been received before the actual content size had been recalculated, which resulted in no scrollbar position change and the cursor had been left out of the view.
-rw-r--r--src/e-util/e-table-item.c2
-rw-r--r--src/e-util/e-table.c14
2 files changed, 16 insertions, 0 deletions
diff --git a/src/e-util/e-table-item.c b/src/e-util/e-table-item.c
index a6b648776e..66a05287d4 100644
--- a/src/e-util/e-table-item.c
+++ b/src/e-util/e-table-item.c
@@ -1008,6 +1008,8 @@ eti_request_region_show (ETableItem *eti,
end_col, end_row,
&x1, &y1, &x2, &y2);
+ eti->cursor_on_screen = TRUE;
+
if (delay)
priv->show_cursor_delay_source = e_canvas_item_show_area_delayed_ex (
GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2, delay);
diff --git a/src/e-util/e-table.c b/src/e-util/e-table.c
index 05bea36703..7856ed4054 100644
--- a/src/e-util/e-table.c
+++ b/src/e-util/e-table.c
@@ -769,10 +769,24 @@ table_canvas_reflow_idle (ETable *e_table)
if (oldwidth != width - 1 ||
oldheight != height - 1) {
+ ESelectionModel *selection_model;
+
gnome_canvas_set_scroll_region (
GNOME_CANVAS (e_table->table_canvas),
0, 0, width - 1, height - 1);
set_header_canvas_width (e_table);
+
+ selection_model = e_table_get_selection_model (e_table);
+ if (selection_model) {
+ gint cursor_row, cursor_col;
+
+ cursor_row = e_selection_model_cursor_row (selection_model);
+ cursor_col = e_selection_model_cursor_col (selection_model);
+
+ if (cursor_row >= 0 && cursor_col >= 0)
+ e_selection_model_cursor_changed (selection_model, cursor_row, cursor_col);
+
+ }
}
e_table->reflow_idle_id = 0;
return FALSE;