• Hello, Guest! Welcome back, and be sure to check out this post for more info about the recent service interruption and migration.

Idea/dream/wish: Exposé for classic Mac OS

Crutch

Well-known member
OK it took a little longer than expected but I have a working beta including a CDEV with all the knobs, seems nice and stable under 7.1 and 7.5.5 in Mini vMac though there are a couple minor bugs to still work out and I have actually NOT tried this on a real Mac yet!

You can expose the desktop by moving the cursor to one or more "hot corners" (including while dragging) or pressing a keystroke (I tried to make the keystroke-setting experience very interactive which was really quite tedious to get right!).

You can un-hide everything by clicking near the edge of the screen, with a keystroke or by using a "hot corner". If you open a hidden window (e.g. by double-clicking its Finder icon), just that one window will un-hide. Switching apps (except to the Finder) un-hides everything.

A fun thing to try is pressing the keystroke while a dialog box is up; all the background windows whoosh away to their hiding places but the dialog box stays put. Not sure if this is a feature or a bug ;)

I hate cdevs that make you restart for changes to take effect ... so mine doesn't make you do that :cool:

I shortened the zoom animation from your initial recommendation @PB170 , it feels punchier this way. Also I matched the Finder which I believe actually shows 5 rects at a time rather than 3 (at least it looks that way to me when freeze-framing in Macsbug).

I don't use MacOS 8 at all so consider this a System 7-specific project for now. Eventually I will get it working under System 6. I don't think I will invest time in MacOS 8 support if it doesn't already mostly work, but would welcome others to take that on later. (This version will crash without the Gestalt Manager ... hey it's a beta!)

This was a tricky project that patches about ten traps so far. It is not perfect. There are plenty of edge cases still to fix. Help appreciated identifying any I may have missed! (One known bug: hiding a WindowShaded window un-shades it. This is due to a particular weird thing WindowShade does which will be hard to work around. Trust me, it's really WindowShade's fault! For now, call it a "known incompatibility.") Source code will eventually be released but there is tons of cleanup to do first ... also proper credits will be added later but @PB170 @cheesestraws already get a hidden cameo mention.

I'll probably add more commentary tomorrow, I'm going to bed!

Screen Shot 2021-11-29 at 10.07.44 PM.png
 

Attachments

  • Exposé 1.0b1.bin
    25.3 KB · Views: 11
Last edited:

robin-fo

Well-known member
You did an absolutely fantastic job! I can report that it works really well on my Colour Classic running System 7.1. (Is my CC the first real Mac this is running on?). I also tested it on System 7.6.1: I was able to use the hot corner three times: The first time, an error message appeard (Error 28); the second time, the animation started but the windows didn't disappear; the third time, nothing happend, but some seconds later, the system crashed (the cursor froze). This behaviour is somehow inconsistent though; I once even had an empty bomb error message some seconds after using the keystroke.

Interestingly, it runs fine on Mac OS 9.0.4...

Some ideas I have:
- Further increase the animation speed (for slower machines). Instead of the "Zoom animation" checkbox, you could add some radio buttons in the control panel like Fast/Slow/No Animation, where "Slow" would be the current animation speed.
- It would be handy to be able to hide the current windows even if there are already some hidden ones: If you would go into the hot corner while pressing the shift key, instead off all windows re-appearing, the new windows would get hidden as well.
 

PB170

Well-known member
OK it took a little longer than expected but I have a working beta including a CDEV with all the knobs, seems nice and stable under 7.1 and 7.5.5 in Mini vMac though there are a couple minor bugs to still work out and I have actually NOT tried this on a real Mac yet!
Well, you sort of raised my anticipation when you shared the videos and said 1–2 days! I initially revisited the page several times a day but eventually stopped after ten days or so :)

Anyway, great news that you got the control panel in place now! Can't wait to try it out on my PowerBook. Will install it when I get home tonight!

A fun thing to try is pressing the keystroke while a dialog box is up; all the background windows whoosh away to their hiding places but the dialog box stays put. Not sure if this is a feature or a bug ;)
That seems very classic-macosy – I'd say it's a feature ☺️

I hate cdevs that make you restart for changes to take effect ... so mine doesn't make you do that :cool:
Great! That certainly makes it much more modern and easy to use.

I shortened the zoom animation from your initial recommendation @PB170 , it feels punchier this way.
I actually had the same thought already from the beginning, and again when I saw your videos, considering there is not just one zoom rect animation and that they might overlap, but I thought it was worth to see how it looked first.

I don't use MacOS 8 at all so consider this a System 7-specific project for now. Eventually I will get it working under System 6. I don't think I will invest time in MacOS 8 support if it doesn't already mostly work, but would welcome others to take that on later. (This version will crash without the Gestalt Manager ... hey it's a beta!)
I was about to ask if I should dare to try it out on OS 9, but I take it that's not advisable then 😄

(One known bug: hiding a WindowShaded window un-shades it. This is due to a particular weird thing WindowShade does which will be hard to work around. Trust me, it's really WindowShade's fault! For now, call it a "known incompatibility.")
This actually happens by just hiding and revealing the Finder under normal use, so I certainly didn't expect you to work around that.

Also, if we can get Exposé to work well on classic Mac OS, it would partly replace WindowShade, at least for me!

Source code will eventually be released but there is tons of cleanup to do first ...
Great! If I could, I would have written this myself long ago, so being able to see how you accomplished it will be terrific learning material.
 
Last edited:

Crutch

Well-known member
@robin-fo thanks for being the first to provide feedback (and thanks for the helpful video).

Error 28 is a particular out-of-memory error (stack collision with heap). One thing I intentionally omitted from the "beta" version was robust memory checking so this isn't altogether surprising (in particular because I allocate a chunk of stack space for an array of ProcessSerialNumbers when you trigger Exposé ... was planning to clean that up later) but I would like to confirm your memory is tight-ish: would you be able to replicate that crash under 7.6.1 after first opening "About This Macintosh..." to check for free memory? I suspect there is nothing inherently wrong with running this under 7.6.1 other than that it takes up more memory than 7.1 so makes you susceptible to this issue.

Your other ideas are great and will get implemented.

@PB170 yeah it would have taken 2 days if I'd just released the original INIT with no config options but I decided to go whole hog with the cdev. Getting the cdev and INIT code to talk nicely to each other in real time without a restart took some tweaking (main issue: turns out when you replace the settings data resource after the user changes it, you need to remember to re-set the System Heap bit on the thing, otherwise it gets cleared and the cdev points to garbage RAM but of course only after the second restart after compiling [since the System Heap bit is set on that resource in my project resource file] ... the delayed failure makes this extremely difficult to catch!).

Please do try it under OS 8 and 9. I have no reason to suspect it won't work, I just don't intend to prioritize fixes until it's working perfectly under Systems 6 and 7. (The Gestalt Manager is missing under most [all? I don't remember] versions of System 6 but is present in all later versions.)

Things I learned (so far):
  • It is completely impossible to reliably patch ExitToShell under 7.5.5 (as far as I can tell) ... I wanted to do this to remove any windows from apps that were Quit from my list of hidden windows. Instead I now check the list vs. every known window on each activation. This is slightly slower and is actually why I am using all that stack space for now ...
  • It is very difficult to tell precisely when the user switches apps. (The process seems to include a bunch of seemingly random calls to _OSDispatch, no one of which is obviously making the switch finally happen.) I found out that patching DrawMenuBar and checking if GetCurrentProcess changed is a great trick to figure this out slightly in arrears, though, which is good enough! Working that out is probably the single thing I am happiest about with this project so far.
 

cheesestraws

Well-known member
Very well done. :-D

I'm looking forward to you releasing the source, I'd really like to have a read and a learn from it.
 

Crutch

Well-known member
Hahaha … yes. I am already patching DrawMenuBar so clearly should have thought of that already!
 

Crutch

Well-known member
If you built the notch as a little custom-shaped window (needs a title bar, Exposé checks for this, but that can be offscreen) that would happen for free!
 

CC_333

Well-known member
@Crutch Can you put a secret check box (like if you hold down command-option) to enable/disable Cheesestraw's Notch? :LOL:
Yes, but as long as it's disabled by default!

To make it fun, it can be implemented as an easter egg, which requires a special (but relatively simple) routine to access (you probably already thought of this, as implied by the word "secret" 🥴 ).

c
 

aladds

Well-known member
Ok this works *really well* on my Q650 under 7.6.1 (and this system has lots of extraneous crud installed like Speed Doubler/Conflict Catcher)

I’m very impressed!
 

PB170

Well-known member
@Crutch, I can't tell you how amazingly cool this is! Thank you so much for helping make this a reality. No more constant double clicking on windows to access the desktop!! I've been running the extension for a while now, and it's completely stable on my setup – super impressive for a beta version, especially considering how tricky it is to program extensions for classic Mac OS, and that you didn't even test it on real hardware. Fantastic work! 🙌🌟

My comments are almost only on the visual aspects.

I'll get back with some feedback later on after I've had some more time to test it.

By the way, would it be okay for you to split the visuals and the programming between us? I'm asking just so that you have some patience with me with my comments on the visual/UX stuff :) Designers, you know ;) :)
 

Crutch

Well-known member
That’s great news! I welcome any and all comments on visuals, UI, design irrespective of how weedy. I studied UI design long ago in grad school and have massive patience with feedback in that area, though my immediate priority will be getting the bugs ironed out and making the thing run fast enough!
 

Crutch

Well-known member
@robin-fo
Here's version beta 2. This is a little better with memory management and should display an error if it runs out of memory rather than just crashing terribly. I'm curious if this happens to you on your 7.6.1 setup?

Oh also it should do the thing you wanted, hold Shift when you mouse into a hot corner and it will always only hide windows (if possible) and never un-hide anything. Seemed liked a good idea so I just did it.,
 

Attachments

  • Exposé 1.0b2.bin
    28.1 KB · Views: 6
Top