Three Monkeys, Three Typewriters, Two Days

March 23, 2008

Calling Mac hackers

For over 10 years now, I've had my window manager set up with the following keyboard+mouse combination shortcuts:

I've also had it set up with "sloppy focus": entering a window with the mouse focuses it, unless it's the root window. Exiting a window doesn't change the focus. So sort of like focus-follows-mouse, except without the "if you hover over the root window, nothing has focus" lossage. Oh, and no raise on focus.

It having been over 10 years, I find myself rather attached to all this, and would dearly like to be able to convince the OS X window manager to let me do something like this. Is there any sort of reasonably supported way to do it? I'm pretty willing to write code as needed, etc, but not if it'll get broken by the next minor OS update.... so binary-patching the window manager, say, is out of the question.

Posted by bzbarsky at March 23, 2008 10:35 PM | TrackBack
Comments

You're naïve. This is Jobs' world, he knows better than you what you need: Exposé. His way or the highway.

Posted by: Sebhelyesfarku on March 24, 2008 1:35 AM

No idea how you can do that, though I presume it's possible since there have been apps in the past that have done similar manipulations (though they tend to break on larger updates).

Having worked on multiple platforms for some time, I've come to the conclusion that making one like another is generally bad practice and more pain than it's worth. At this point I can pretty much adapt to the platform in a few minutes.

Only notable exception is that I use a two button mouse on a Mac since the late 90's. One button mouse is just not cool. I wish Apple would have made a more abrupt departure back in 98' when switching to new-world mac's.

Posted by: Robert Accettura on March 24, 2008 7:22 AM

Your only hope is to go through Unsanity's APE system. I know other people have made "Haxies" that do unheard-of things with the window-making code, so it's plausible that you could get this system to work there, too.

Posted by: Nick Fagerlund on March 24, 2008 7:44 AM

I seem to think that your "sloppy focus" is part of one of the Universal Access (accessibility) features these days—though maybe it's only when Voice Over is enabled, which wouldn't be so helpful. I'll have to check my newer Mac to be sure.

I've actually used an *application* for years which lets me toggle between the Mac OS and Mac OS X windowing behaviors (clicking raises all in the app vs. clicking raises only the clicked-on), and it only needed updates for 10.3 and 10.5, so depending on the behavior, it's certainly possible to write something both more friendly and more stable than a Haxie.

OTOH, Cmd has an explicit and widespread meaning of "do stuff without raising or focusing" when dealing with background windows, so there might be a lot of work involved in bypassing that to achieve your desired behaviors.

Posted by: Smokey Ardisson on March 24, 2008 8:59 AM

Here's a sketch idea of something that could work:

* Make a windowless app
* Make it install an event tap (google for CGEventTapCreate) that taps all these events you're interested in
* Use the Cocoa Accessibility APIs to focus/move the windows as needed

/Håkan

Posted by: Håkan W on March 24, 2008 9:23 AM

I don't think that writing a Haxie is needed. "Witch" uses an accessibility API to to window manipulation. Maybe you can get in contact with its developer: http://www.manytricks.com/witch/

Posted by: Markus on March 24, 2008 11:41 AM

It's not exactly what you want, but you can hold down the Command key to move windows that are not in the foreground around. You can only operate on the parts of them that normally cause window drags, but it's a feature I've found useful.

Posted by: Colin Barrett on March 24, 2008 1:57 PM
Post a comment