• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

System 7.1 grow icon tiny visual bug?

Crutch

Well-known member
I think @PB170 has discovered a bug in System 7.1 and I want to sanity check myself (this came up in the Exposé development thread but I now think it's an issue in System 7.1 itself, not in Exposé ... the below happens even when Exposé is not installed).

I want to see if everyone else gets the same behavior, I'm running 7.1 on Mini vMac emulating a Mac II and will try it on a real machine later:
  • Open any Finder window
  • Drag it halfway off the left edge of the screen
  • Force it to refresh itself, for example by opening another folder that partially covers it then clicking back
  • I end up seeing a corrupted grow box icon 100% of the time (see image below, "System 7.1 Startup" window grow box icon is displaced 1 pixel down and has a weird double border at the top as a result)
Does anyone/everyone else see this under 7.1?

Once this happens you can "fix" it by dragging the window back fully onto the screen and forcing a refresh again.

This does NOT happen under 7.5.5. I think someone at Apple found the bug between these releases ... :)

Screen Shot 2021-12-05 at 6.43.49 AM.png
 

PB170

Well-known member
I was going to say, that I've been using System 7.1 daily for more than 25 years now and I've never seen that happen. But when I test it, indeed, there it is…! It actually happens as soon as the window's content area touches the left side of the screen.

What I'm almost certain that I've never seen though is the partially corrupted grow box that turned up in the Exposé development thread. I noticed it immediately, and I'm sure I would have done so earlier as well if it had turned up then.
 

Crutch

Well-known member
I built a test app to demonstrate this:

1. If you move ANY document window under 7.1 such that it is ALMOST entirely off the left edge of the screen, BUT part of the grow box is still on the screen (using MoveWindow),
2. Then move the window back entirely onto the screen (using MoveWindow)
3. Then update it in the “normal” way (by calling DrawGrowIcon inside a BeginUpdate/EndUpdate bracket after getting an updatEvt)

… you will see a partially corrupted grow box 100% of the time.

This is because the part of the grow box that never left the screen was drawn the “bad” way while the window was partially off-screen (and is not redrawn), but the part of the grow box that was entirely off screen is redrawn correctly.

Result: a partially corrupted grow box.

I didn’t try to reproduce this in the Finder, I’m not sure how it updates its windows, but I’m certain you could reproduce this in some other apps if you managed to position the window just right.

Exposé, of course, positions windows like this 100% of the time they are near the left edge, making it instantly noticeable. But it has nothing to do with Exposé.

That said, I have a workaround (force a redraw of the whole grow icon every time with _InvalRect, which should not be necessary!), it works, and I’ll will share it this weekend.
 
Last edited:

PB170

Well-known member
That makes sense. I didn't try that when I tested it, but manually moving the window so that the grow box is partially off the screen results in it getting corrupted when it's moved back, both in the Finder and in apps. This, of course, requires you to grab the window by the very edge so it's very unlikely to happen during normal use, which explains why I can't remember ever seeing it.

A bit unfortunate that we're forced to do additional redrawing when we're also trying to make the extension as speedy as possible, but not much to do :(
 

Crutch

Well-known member
Btw I confirmed you can easily replicate this in the Finder. Just grab the very right edge of the window, drag it 99% of the way off the screen so that the grow box is partially obscured, then drag it partly but not all the way back on screen (so that some portion still sticks off the screen ... not sure why this matters here, but it does). Presto, instant corrupted grow box. Weird bug for Apple to have let slipped thru in 7.1.
 

CC_333

Well-known member
Interesting.

Rather than working around it on an app-by-app basis, I wonder if there's a way to patch it system wide via an extension or resource hack instead?

c
 

Crutch

Well-known member
There certainly would be. (Dumb/naive way: patch DrawGrowIcon to check if window’s left edge is offscreen; if so, offset the window’s origin by 1 pixel upward before calling the normal DrawGrowIcon.) Though it’s a really obscure bug so the satisfaction from doing so would be pretty small, especially since there is already an ”official” fix: upgrade to 7.5.5. ;) One would also have to make a list of all impacted system versions and have the patch do nothing if an older/newer version is running. All I know as of now is that this happens in 7.1 but not 7.5.5.
 
Top