Musings from Mars Banner Image
For Software Addicts: Yes!MaybeNah!
Mars Report:

Desperately Seeking Clarity: Wiping the Dirt from My Crystal Clear Menubar

Published June 3rd, 2007
Click  to play or hide movie.
Click  to play or hide movie.

If you're a fan of Crystal Clear who's noticed—and been seriously bothered by—the "smudges" on the Crystal menubar behind most of your menubar apps, I think you'll be pleased by this report about the new version of Crystal Clear. Work on the menubar is hardly the only improvement in the theme, but it's probably the most significant one.

I think of the menubar smudges as "extra shine," because that's kind of what they are: They result from a double layer of the menubar graphic in the space the menu extras occupy. This smudging might not be so distracting if it were applied evenly across all of the menu extras, but of course that's not the case. As a result, from the first menu extra over to Spotlight, the "smudge" comes and goes and can be visually disturbing if you let it.

A Fully Dirty Menubar

This smudging is the number one complaint about Crystal Clear, and I'm very pleased to announce that the new version will offer a nice, clean, truly crystal-clear menubar with (virtually) no dirt whatsoever! Unfortunately, you can't download it today, because I don't have all the files quite ready. But I promise to make them available very soon. :-)

On the way to achieving this, I've ended up learning way more than I ever wanted to about the OS X menubar. As it turns out, the items that display the extra shine are apps that use a Cocoa API Apple made available around the time of Panther. Menubar apps developed to this specification all show the shine. Prior to this, Apple had shut down developer access to an earlier API—one that defined the original concept of "menu extras", which were supposed to merely display system status of one kind or another. That is, the actual menu extra API was designed for very limited utility: Apps could display their status (Airport menu, Sound Volume menu, Displays menu) and not much else. These kinds of menu extras run in the "System StatusBar", not in a menubar, and in fact are controlled by the SystemUIServer process that you may have seen if you watch Activity Monitor much. (Strictly speaking, the "menubar" is the, uh, menubar that starts just before the Apple menu and ends after the Spotlight menu. The "statusbar" actually overlays the menubar and starts to the left of Spotlight and runs until the last "status item", or true "menu extra".)

A Partly Dirty Menubar

When Jaguar was released, Apple shut down this original API for third-party use, resulting in a fair amount of developer grousing—for obvious reasons. Naturally, the shutdown didn't stop our resourceful Mac developer community for long... Someone and his friends quickly provided the MenuCracker utility, an open source project that anyone could use to take advantage of the original API for their menu extras. Examples from my own menubar of tools that still use MenuCracker are the essential MenuMeters app and the ubiquitous WinSwitch menu extra, a nice upgrade for managing fast login/out.

Since these menu items utilize the original API (the one that rides on SystemUIServer), they don't add their own background to the menubar either.

Of course, the limited utility of the "status-type" menu items hasn't been sufficient to keep users and developers happy over the years. When Apple made the new API available, many apps quickly adopted it instead of using MenuCracker. The new API lets a developer make available menu items that can be full-fledged applications. Such "real" applications like Quicksilver, Butler, iKey, Alarm Clock, MagiCal, AppStop, DropCopy, WeatherMenu, and literally dozens of others want to display Preferences, perhaps present a menubar of their own, spawn child windows, live in the Dock as well, etc. Like any other application, these menu items conjure up a menubar for themselves, but it only shows up in the tiny bit of real estate they call their own.

A Clean Menubar

As I've previously confessed, I'm a rank newbie when it comes to Objective C and Cocoa, but I've nevertheless spent untold hours pouring through Apple's documentation and the source code for apps like Hallon and MenuMeters trying to find a way to turn the menubar off in the "new style" menu items. I've also been using the powerful and highly entertaining (to hackers) F-Script framework to poke around inside these apps. (Apple actually promotes the use of F-Script, a Smalltalk derivative that's one of the best ways to learn how Cocoa apps pass messages to each other and to themselves.)

Alas, none of this time has yielded a solution, and I once again put out a call for ideas from any Cocoa wizards who may wander in to this article.

But! A brick wall never stops a resourceful Martian. Though we can't really walk through walls, we are very good at finding quick ways to go around—or over—them. :-)

Thus, one morning last month I had an epipheny about the Crystal menubar problem that more or less amounts to "If you can't beat 'em, find a way to work with 'em instead." My thinking was jogged by a solution that another themer had come up with for the popular PhotoPro theme, which has a translucent menubar in one of its variants.

I briefly toyed with the idea—suggested by another Crystal Clear user—of offering the "menu extra" fix that the developer of PhotoPro did. When I first tried that fix a few months ago (prior to developing Crystal Clear), I thought it was too difficult to expect users to mess with more than once or twice. I still do, but if you are someone who doesn't reboot very often and are not a heavy user of menu extras (or at least, don't add them to your menubar many times during a session), it might be worth it to fix the menubar look temporarily.

A Real Clear Menubar

If I had done this for Crystal Clear, the fix would involve these steps:

  1. Apply Crystal Clear, or have it run normally at login.
  2. Apply a second theme (the fix) that would eliminate the menubar entirely. While this theme is in place, you would quit and restart all of the menu extras that do the "double layer" thing.
  3. Next, set ShapeShifter's preferences to NOT restart the Finder/Dock when it applies themes, and then apply Crystal Clear a second time.
  4. Once this is done, restart the Finder.

I tried this again in late April, and sure enough, if you follow the steps exactly, you no longer have any menu extras that are "too shiny". However, to maintain this look, I would have to repeat this procedure every time I log in and out or reboot, and any new menu extras I add after the "fix" would be too "shiny" until I applied the "fix" again.

Now, I love theming and I love fiddling with the look of my desktop, but I want those things to serve me—not the other way around!

One central idea from the PhotoPro "fix" did lodge in my consciousness, however, and literally overnight I had a "light bulb" moment and an idea so simple and obvious it couldn't possibly work... or could it?

A Real Clear Menubar

The essence of the PhotoPro fix is that you apply a theme that has no menubar at all. You then load all the menu extras while this theme is active... so they, too, have no menubar. That's a great idea, and if it weren't for all the applying of themes and starting/stopping of applications, it would be fine for Crystal Clear.

But what if you eliminated the menubar altogether? Well, I've tried the blank menubar look, and it's interesting, but I missed my Crystal Clear menubar! OK, so how about putting the menubar on the desktop picture instead of putting it in the theme itself?

Woah! Could that work? And a bit to my surprise, I found that the answer was, "Hallelujah!"

Basically, I found that if I made Crystal Clear so that it didn't draw any menubar at all and then modified a desktop picture, putting the menubar at the top and sizing it precisely for my monitor, it looks and acts for all the world like the menubar you and all of us want from this. The menu extras don't draw any background because, well, their background is nil. But they do get the highlight color, because the items still respond to mouse input.

The short QuickTime movie at the start of this article shows the menubar in action as new "extras" are loaded. As you see, it's now a case of "Look, Ma! No dirt!" The only downside here is that you need the right background picture. That could be a problem for some folks, but I plan to make that real simple as well.

First, the new version of Crystal Clear will have four of Xanthic's desktop pictures sized in the four most-common resolutions for today's Macs: 1920x1200, 1680x1050, 1440x900, and 1280x800. Each of these has the appropriately sized menubar included. The four desktops are the ones illustrating this article: Flexibility, Colourblind, Firefly, and Hydrogen5.

A Real Clear Menubar

In addition, I'm making available a Photoshop file of the menubar graphic itself, also in those four sizes. All you have to do is add the menubar to your favorite desktop pic, et voilà! In the desktop pics I'm providing, I found that compositing the menubar on dark images as a "Linear Dodge" layer produced the best effect, but one of the pleasures of this approach is that you can customize how the menubar looks to suit your own taste.

The only wrinkle appeared when a beta tester ran the new setup on an Intel-powered MacBook. He reported that the menubar's menu items were only active if he clicked directly on their lettering. The spaces between letters and around words would not activate the menu. Obviously, this wouldn't do.

I doublechecked my G5 PowerMac, because I hadn't noticed such behavior during a month of testing. Sure enough, on this kind of Mac, the menubar obeyed the rectangular click zone defined in ThemePark, even when the menubar was completely transparent. Then I tested on a recently acquired Intel MacBook Pro, and verified the beta tester's finding. As a result, in the end I had to include an almost-but-not-quite-transparent menubar to enable proper menu functionality on the newer Intel Macs.

This configuration results in a very faint shine that's almost completely unnoticeable. Certainly, it's not the distraction that marred previous versions of Crystal Clear. (On my PowerMac, I may go back to the completely invisible menubar, and if I can think of a way of doing so without busting my bandwidth, I'll try to make such a version available as an optional download.)

I have just a little more work to do on Crystal Clear (the menubar is only one of the many updates coming in the new release) and will then add the new version to Mars. Stay tuned. :-)

  • Google
  • Slashdot
  • Technorati
  • blogmarks
  • Tumblr
  • Digg
  • Facebook
  • Mixx

Show Comments
Just Say No To Flash