I’m definitely going to make a change, can’t leave that error in. I was hoping your results might inform how I proceeded, but they don’t. I was kind of thinking maybe the function would return a height of zero, failing completely.
The code that is in there now is trying to center the progress window on the screen so that it looks nice. I’ve added a check for this error, and if that happens, it will just place the window near the upper left corner of the screen. Not as cosmetically pleasing, but vastly superior to an error message.
I’ll bet the intermittent nature of this is due to the fact that this code is not called every time the database opens, only if it needs to be synchronized or updated. In fact, I think it doesn’t always happen if synchronization is needed, only if it is a fairly large amount of data that needs to be synced, enough to make it worth displaying a progress window. So most of the time, you won’t see the problem.
Hmm, now that I have written that down, I wonder if the line you commented out had anything to do with it. In fact, I see the problem – it’s not that line, the problem is two lines below that. I forgot that there is another case where it displays the progress window – if the tool bar is hidden. You have the tool bar hidden on some of your databases, don’t you (I think I’ve seen that in some of your screen shots). In that case it is trying to center the progress window in the current window, and most likely in this particular case the window is less than 200 pixels high. That would immediately cause this error, but it would be very intermittent, as I mentioned in the last paragraph.
So, now I think I’m pretty confident I really know what is going on, and I have made the fix. I also added additional instrumention, so in case I’ve botched the fix, the needed data will be in the log.
In the meantime, I’ll bet you’ll eventually see this error again. Or, if you want, since you’ve already updated the OpenAsyncProgressWindow procedure, you can do it again to put in the fix – here is the revised code, starting from line 67:
let availableArea = getdictionaryvalue(taskInfo,"WINDOWRECT",rectanglesize(0,0,0,0))
zlog "caller provided availableArea: "+rectanglestr(availableArea)
try
if rheight(availableArea)<220 or rwidth(availableArea)<windowWidth+20
zlog "availableScreenRectangle: "+info("availablescreenrectangle")
availableArea = rectangletweak(info("availablescreenrectangle"),
"widthfromcenter",windowWidth,"+heightfromcenter",-200)
else
availableArea = rectangletweak(availableArea,"widthfromcenter",windowWidth,"+heightfromcenter",-200)
endif
catch
availableArea = rectanglesize(100,200,400,windowWidth)
endcatch
zlog "adjusted availableArea: "+rectanglestr(availableArea)
The next line after this is:
let openProgressWindowNumbers = getformoption("_DialogAlertLib","Progress","clonewindownumbers")
I’m not sure what line number that is in the code you have.