From: Taylor R Campbell Date: Thu, 28 Apr 2011 22:11:02 +0000 (+0000) Subject: Update terminal drawing operation costs on resize. X-Git-Tag: 20110609-Gtk~16^2~4 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=bf7152ab211e035c980f45cc782fcd36608d2ec2;p=mit-scheme.git Update terminal drawing operation costs on resize. Fixes random errors during redraw after expanding your terminal. Evidently nobody uses Edwin in a terminal, at least since I broke this five years ago... --- diff --git a/src/edwin/tterm.scm b/src/edwin/tterm.scm index 63d7b71a7..952a82be1 100644 --- a/src/edwin/tterm.scm +++ b/src/edwin/tterm.scm @@ -427,11 +427,11 @@ USA. (description false read-only true) (baud-rate-index false read-only true) (baud-rate false read-only true) - (insert-line-cost false read-only true) - (insert-line-next-cost false read-only true) - (delete-line-cost false read-only true) - (delete-line-next-cost false read-only true) - (scroll-region-cost false read-only true) + (insert-line-cost false) + (insert-line-next-cost false) + (delete-line-cost false) + (delete-line-next-cost false) + (scroll-region-cost false) (cursor-x false) (cursor-y false) (standout-mode? false) @@ -1182,9 +1182,24 @@ Note that the multiply factors are in tenths of characters. |# (if (or (not (= x-size (screen-x-size screen))) (not (= y-size (screen-y-size screen)))) (begin - (without-interrupts - (lambda () - (set-tn-x-size! desc x-size) - (set-tn-y-size! desc y-size) - (set-screen-size! screen x-size y-size))) - (update-screen! screen #t)))))))) \ No newline at end of file + (update-terminal-size! screen state desc x-size y-size) + (update-screen! screen #t)))))))) + +(define (update-terminal-size! screen state desc x-size y-size) + (receive (insert-line-cost + insert-line-next-cost + delete-line-cost + delete-line-next-cost + scroll-region-cost) + (let ((baud-rate (terminal-state/baud-rate state))) + (compute-scrolling-costs desc baud-rate x-size y-size)) + (without-interrupts + (lambda () + (set-tn-x-size! desc x-size) + (set-tn-y-size! desc y-size) + (set-terminal-state/insert-line-cost! state insert-line-cost) + (set-terminal-state/insert-line-next-cost! state insert-line-next-cost) + (set-terminal-state/delete-line-cost! state delete-line-cost) + (set-terminal-state/delete-line-next-cost! state delete-line-next-cost) + (set-terminal-state/scroll-region-cost! state scroll-region-cost) + (set-screen-size! screen x-size y-size))))) \ No newline at end of file