n8blog
distraction in action

The Mac users of the Mojave lab are pleased to announce a handy new app: Forget-Me-Not!

FMN is an app that evolved from a hack I wrote a while back to solve one of the myriad annoyances of the OS X window manager. If you’ve got a PowerBook or MacBook (ick. I still can’t stand that name) that you connect to an external monitor you’ve probably noticed that the layout of your windows doesn’t survive a connect/disconnect cycle. If you go from dual-head to single-head back to dual-head all your windows end up in a corner of one monitor afterwards. A similar thing happens if you connect to a low-resolution 800×600 projector, or a TV—you find your windows tiny and bunched up when you get back to your normal desktop. Well, FMN solves that problem.

You can get FMN and find out more about what it does here, but I thought I’d mention a bit of its history in this blog post. Oh, and if you have any comments or bug reports, feel free to skip this stuff and post a comment below.

I first developed FMN in a couple of hours as a plugin for Desktop Manager, exploiting the fact that DM injects code into the Dock process and can thus be used for all sorts of mischief. My lab-mate David Noblet was jealous of my machine’s newly-found super powers but not a DM user, so he ported my code to a stand-alone app. After a bit of noodling we found out about Apple’s Accessibility API and Dave rewrote the app to use it, thus ending our reliance on Dock-injection haxiness. But there was still one problem: X11.app doesn’t export its windows to the Accessibility system1, and I can’t live without X11 support. So the next step was to write an “X11 bridge,” which I did without too much difficulty. In the process I converted the app to have a plugin architecture2.

At this point everything was working, but we wanted to release FMN to the public and the interface was not ideal. The proper way to interact with something like FMN is a preference pane—it’s basically a per-user preference. So next we set about learning how to write preference panes, how to use distributed objects to communicate with background apps from them, and how to hide an app’s UI. Along the way Dave whipped up some artwork for us to work with, and we started using DARCS as our revision control system.

So anyway, after a lot of messing about with XCode, Interface Builder, Inkscape, and all the rest we’ve got something we think you’ll like. Let us know how it could be better!

1 This, by the way, is the reason why nice apps like Witch don’t work on X11 windows, making them useless to lots of people. It’s a pity that one’s not open source because I’ll probably end up rewriting it myself one of these days. If I had the source it probably wouldn’t be hard to write a simple X11 bridge.

2 This wasn’t just architectural masturbation, by the way. If a user doesn’t have the X11 libraries installed you don’t want to be shipping an app that’s dynamically linked to them—your app will crash. If you ship a plugin that’s linked to them it just won’t load, which is no big deal.

  Comments:

1. Dallas replies:

I just discovered this today and it is exactly what I was looking for. How fortuitous! So far it seems to work pretty well! I’m not sure I like how it handles windows it doesn’t have any information for, though. For instance, if you are on your small screen (my powerbook) and you create a new browser window and then switch to the larger screen (a 1600×1200 lcd display) all of the windows it ‘knows’ about are resized but the new browser window is not. That makes sense but maybe it could instead resize the new browser window to match the other windows of the same application? I don’t know what would be best but that’s something I noticed.

Also, it is a bit weird with Adium’s contact list window for some reason. It just doesn’t seem to work right.

And I would like to see the addition of the dock ‘hiding’ preference as something that is saved and restored. I like to have the dock hidden when I’m on the small screen of the powerbook and unhidden when I’m on the larger screen.

Overall though, FMN works quite well and is far better than anything else I’ve found!

2. n8 replies:

Dallas — Glad you like FMN! It’s a pretty dumb app right now. Getting it to do something non-annoying with new windows it’s never seen before would mean making it a lot smarter, and I don’t even know if there’s any universally sensible policy for them.

I’ll take a look at the Adium thing. Some windows (mostly non-Cocoa apps) don’t respond well to being resized by the accessibility API. Word, for example, has some problems. There’s actually a way to have apps be ignored completely by FMN, so if it just makes you miserable for some app it can be done. I’m also thinking of adding a way to mark certain apps “do not resize”. Everything except the UI is dead simple.

I’ve had the same thought about dock hiding. FMN’s plugin architecture would make it easy to add something like that.

Thanks for the feedback! Feel free to rate us on MacUpdate if you’re feeling spunky! ;-)

3. n8 replies:

Dallas - I tried installing Adium but I didn’t notice any problems with the contacts window. I didn’t actually *have* any contacts, so that may have been why I didn’t see anything. In any case, if you can contact me by e-mail (n8gray at caltech dot edu) with any extra details you can supply I’ll see if I can reproduce the problem.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please type this word with the letters reversed: live