- int index = ui_selected_index();
- int topleft = c -> col_max * ui_rows_scrolled_down;
- int botright = ( c -> col_max * ( ui_rows_scrolled_down + c -> row_max ) - 1 );
-
- if ( index < topleft ) {
- ui_rows_scrolled_down -= pnd_conf_get_as_int_d ( g_conf, "grid.scroll_increment", 1 );
- render_jobs_b |= R_ALL;
- } else if ( index > botright ) {
- ui_rows_scrolled_down += pnd_conf_get_as_int_d ( g_conf, "grid.scroll_increment", 1 );
- render_jobs_b |= R_ALL;
- }
+ unsigned char autoscrolled = 1;
+ while ( autoscrolled ) {
+ autoscrolled = 0;
+
+ int index = ui_selected_index();
+ int topleft = c -> col_max * ui_rows_scrolled_down;
+ int botright = ( c -> col_max * ( ui_rows_scrolled_down + c -> row_max ) - 1 );
+
+ if ( index < topleft ) {
+ ui_rows_scrolled_down -= pnd_conf_get_as_int_d ( g_conf, "grid.scroll_increment", 1 );
+ render_jobs_b |= R_ALL;
+ autoscrolled = 1;
+ } else if ( index > botright ) {
+ ui_rows_scrolled_down += pnd_conf_get_as_int_d ( g_conf, "grid.scroll_increment", 1 );
+ render_jobs_b |= R_ALL;
+ autoscrolled = 1;
+ }
+
+ } // while autoscrolling