jcs
/detritus
/amendments
/5
util: Avoid a redraw on an existing progress dialog
jcs made amendment 5 about 1 year ago
--- util.c Mon Sep 30 21:43:08 2024
+++ util.c Mon Sep 30 22:08:40 2024
@@ -885,6 +885,7 @@ progress(char *format, ...)
Rect bounds;
Rect trect;
short ttype;
+ bool new = false;
if (format == NULL) {
if (progress_dialog != NULL) {
@@ -910,16 +911,19 @@ progress(char *format, ...)
center_in_screen(330, 60, false, &bounds);
progress_dialog = NewDialog(nil, &bounds, "\p", false, dBoxProc,
(WindowPtr)-1L, false, 0, progress_ditl_h);
+ new = true;
}
GetDItem(progress_dialog, 1, &ttype, &thandle, &trect);
SetIText(thandle, progress_s);
- ch = GetCursor(watchCursor);
- c = **ch;
- SetCursor(&c);
- ShowWindow(progress_dialog);
- DrawDialog(progress_dialog);
+ if (new) {
+ ch = GetCursor(watchCursor);
+ c = **ch;
+ SetCursor(&c);
+ ShowWindow(progress_dialog);
+ DrawDialog(progress_dialog);
+ }
}
void