Icon-O-Matic windows appearing entirely off-screen.

Description

Since the icons in the Haiku source are not correctly associated with Icon-O-Matic when you check out the source, I was highlighting many of them and choosing Icon-O-Matic from the "Open with..." dialog so that I could then ALT-S, ALT-W to save and close each window, thus correctly associating the icons so that I could view them in Tracker and open them with a normal double click.

The problem arises when it opens those many windows. Each subsequent window opens slightly down and to the right of the previous one... but when you do this with many windows, they go right off the bottom right edge of the screen.

Luckily I was just saving and closing each window with the hotkeys anyway, but this isn't good behavior.

Attached a patch that addresses the issue. Is it acceptable to hardcode those pixel values? It depends on the border width and window tab height... One could move it into the MainWindow() constructor and use DecoratorFrame(), but then IconEditApp's member fLastWindowFrame isn't kept uptodate.

Forget that first patch. I went with more or less 1:1 copying from StyledEdit. I changed that one too to use a variable for the window offset. I also adjusted the horizontal value so a window is now flush to the screen border. As long as the decorator doesn't change...
Should there be some BControlLook thingy or something to get dimensions of borders, window tabs etc.? I know BWindow has a DecoratorFrame() but that doesn't help here.

I would prefer to put it into a new file into shared, and use that from both instead of duplicating the same code.

You could either create the window first, and then do the cascading with the window as argument (which could could use to retrieve the decorator frame), or pass in the last opened (or even current) window as a reference to compute the offset from.

As per that ticket, I have a Ruby prototype for a "NewWindowPolicy" class which I will port to C++ and put in the the shared kit, then it could also be used for Icon-O-Matic, and other applications which need that behavior. Given this, I'll take over this ticket, and #9546.