[PATCH] unnecessary screen redraw in options_menu.c

Dennis Preiser <[email protected]> Sat, 14 May 2011 12:55:44 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
While using tin over a (slow) serial line I noticed, that, e.g. page
down and page up in 'm'enu, causes an unnecessary screen redraw.

The reason is options_menu.c:redraw_screen() which calls my_retouch()
and show_config_page().

In case of page down, my_retouch() repaints the current screen and
show_config_page(option) did a ClearScreen() and paints the new screen
(after page down).

The attached patch shifts my_retouch() and set_xclick_off()
(->GLOBAL_REDRAW_SCREEN case in config_page()). That's the way we call
my_retouch within the other level (select, group, thread...).

Dennis

--- tin-2.0.0_r3/src/options_menu.c	2011-05-11 20:45:36.000000000 +0200
+++ tin-2.0.0_r4/src/options_menu.c	2011-05-14 11:47:16.000000000 +0200
@@ -772,8 +772,6 @@ static void
 redraw_screen(
 	enum option_enum option)
 {
-	my_retouch();
-	set_xclick_off();
 	show_config_page();
 	highlight_option(option);
 }
@@ -923,6 +921,8 @@ config_page(
 	set_last_option_on_screen(0);
 
 	redraw_screen(option);
+	set_xclick_off();
+
 	forever {
 		switch ((func = handle_keypad(option_left, option_right, NULL, option_menu_keys))) {
 			case GLOBAL_QUIT:
@@ -1209,6 +1209,8 @@ config_page(
 
 			case GLOBAL_REDRAW_SCREEN:
 				set_last_option_on_screen(first_option_on_screen);
+				my_retouch();
+				set_xclick_off();
 				redraw_screen(option);
 				break;
 
@@ -2496,6 +2498,7 @@ scope_page(
 
 			case GLOBAL_REDRAW_SCREEN:
 				my_retouch();
+				set_xclick_off();
 				show_scope_page();
 				break;