TIL: SetIconState and redraw loops
nemo (145) 2546 posts |
This flummoxed me for ten minutes until I put my thinking head on. While trying to debug a redraw loop I got it to push some text into an indirected icon in a different window. Somehow in doing so I seemed to have corrupted the redraw block, because it then errored with the oddly formatted “Get_Rectangle not called correctly” (Get_Rectangle? Who dis?). I could not find the memory corruption. And that’s because it wasn’t my side of the fence. Naturally the “put some text in an icon” function was calling Wimp_SetIconState in order to cause the text change to be updated in that other window. That involves adding a dirty rectangle to the list of rectangles for that window. Under normal circumstances you can dirty as many of your windows as you like at the same time… but it turns out that the Wimp does not like you dirtying window B whilst redrawing window A, but it’s not smart enough to error the SetIconState that breaks things. I’m not terribly impressed with either the restriction or the internal confusion, but it’s good to know it exists. Update your StrongHelps: Don’t call Wimp_SetIconState during a redraw loop. |