How to Write MissionControl/Expose Replacement

  • I'd like to know how to how to write my own MissionControl/Exposè replacement for Mountain Lion.  I am very new to Cocoa, and this might be my first project with Cocoa.

    For those of us who think it might not be possible, it is already done in TotalSpaces (http://totalspaces.binaryage.com).  Whether its a good idea to write a basic OS feature replacement remains to be debated.

    I am wondering how to do the following basic things.

    1)  I am going to need to know how to get a list of all open windows including full-screen apps.  I'll need to iterate over these and get a preview image of these.  How do I get this?  Will the technique work for all apps written is any framework, or will it only work for apps written in Cocoa?  What about legacy Carbon apps?

    2)  I'll also need to get notified that a particular window was resized, so that I can update my thumbnail images.  MissionControl thumbnails are live---as the source window updates, the thumbnails also update.  I'd like to support this, and would like to know how.

    3)  Once the user selects which windows to bring to top, I'd like to programmatically hide the others that don't belong to the current Space.  How does one hide a window?

    4)  Animation.  I have read a book on Core Animation, so I know some bits and pieces.  I am thinking that I will need to create a CALayer, draw every thumbnail on it, place the CALayer on top of everything on the desktop, do the animation, and then hide the CALayer.

    5)  I'd like to control the action that the window is about to take when the user clicks the minimize button.  How does one do this?  I'd like to perform my own custom animation.

    6)  And finally, I'd like to intercept CMD-TAB and like to do my own thing.

    Any pointers on these topics will be greatly appreciated.  I'll also like to know if someone has done an open source project that does similar things so that I can get the idea.
  • On Aug 18, 2012, at 4:26 PM, Commodore 64 <salmankhilji...> wrote:

    > I'd like to know how to how to write my own MissionControl/Exposè replacement for Mountain Lion.  I am very new to Cocoa, and this might be my first project with Cocoa.

    ... Why?

    Charles
  • On Aug 18, 2012, at 4:37 PM, Charles Srstka <cocoadev...> wrote:

    > On Aug 18, 2012, at 4:26 PM, Commodore 64 <salmankhilji...> wrote:
    >
    >> I'd like to know how to how to write my own MissionControl/Exposè replacement for Mountain Lion.  I am very new to Cocoa, and this might be my first project with Cocoa.
    >
    > ... Why?
    >

    Because MissionControl is not spatially stable.  The windows keep moving around and you always have to search for it visually.  Its useless for a power user.

    Please see:  http://www.cc.gatech.edu/~craig/windowscape.htm
  • For items 1 and 2, start with the "SonOfGrab" sample app. Everything you need to know about window contents is in there. I tweaked it heavily to make a utility for getting live updates of windows on other Spaces for debugging. (Alas, windows do not report their Space ID - a public but optional dictionary value - in Mountain Lion, so it's less useful now.)

    As for the rest of it - even if you could find a way to modify windows without asking their app nicely, you'll probably break some of them.

    ----- Original Message -----
    From: "Commodore 64" <salmankhilji...>
    To: "CocoaDev list" <Cocoa-dev...>
    Sent: Saturday, August 18, 2012 2:26:33 PM
    Subject: How to Write MissionControl/Expose Replacement

    I'd like to know how to how to write my own MissionControl/Exposè replacement for Mountain Lion.  I am very new to Cocoa, and this might be my first project with Cocoa.

    For those of us who think it might not be possible, it is already done in TotalSpaces (http://totalspaces.binaryage.com).  Whether its a good idea to write a basic OS feature replacement remains to be debated.

    I am wondering how to do the following basic things.

    1)  I am going to need to know how to get a list of all open windows including full-screen apps.  I'll need to iterate over these and get a preview image of these.  How do I get this?  Will the technique work for all apps written is any framework, or will it only work for apps written in Cocoa?  What about legacy Carbon apps?

    2)  I'll also need to get notified that a particular window was resized, so that I can update my thumbnail images.  MissionControl thumbnails are live---as the source window updates, the thumbnails also update.  I'd like to support this, and would like to know how.

    3)  Once the user selects which windows to bring to top, I'd like to programmatically hide the others that don't belong to the current Space.  How does one hide a window?

    4)  Animation.  I have read a book on Core Animation, so I know some bits and pieces.  I am thinking that I will need to create a CALayer, draw every thumbnail on it, place the CALayer on top of everything on the desktop, do the animation, and then hide the CALayer.

    5)  I'd like to control the action that the window is about to take when the user clicks the minimize button.  How does one do this?  I'd like to perform my own custom animation.

    6)  And finally, I'd like to intercept CMD-TAB and like to do my own thing.

    Any pointers on these topics will be greatly appreciated.  I'll also like to know if someone has done an open source project that does similar things so that I can get the idea.
  • On Aug 18, 2012, at 4:48 PM, Commodore 64 <salmankhilji...> wrote:

    > Because MissionControl is not spatially stable.  The windows keep moving around and you always have to search for it visually.  Its useless for a power user.

    Which windows, what what do *you* mean by "spatially stable?"

    If you mean that the screen order changes? That's an option in the Mission Control preferences pane ("Automatically rearrange spaces based on most recent use").  If you mean by the order of the applications on each screen, then that could be an issue.

    --
    Glenn L. Austin, Computer Wizard and Race Car Driver        <><
    "Where there's breath, there's hope!"
    <http://www.austin-soft.com>
  • On Aug 18, 2012, at 11:08 PM, "Glenn L. Austin" <glenn...> wrote:

    > On Aug 18, 2012, at 4:48 PM, Commodore 64 <salmankhilji...> wrote:
    >
    >> Because MissionControl is not spatially stable.  The windows keep moving around and you always have to search for it visually.  Its useless for a power user.
    >
    > Which windows, what what do *you* mean by "spatially stable?"
    >

    Spatially stable means that MissionControl/Exposé does not try at all to keep a window where you last saw it.  Here is how to repro it:

    1)  Open yourselves a dozen or so windows.
    2)  Invoke MissionControl/Exposé.
    3)  Notice the position of your favorite window, say Mail.  Perhaps it is in the lower-left corner?
    4)  Keep working and invoke it again after diong something.
    5)  Mail may now all of a sudden appear in the top-right corner for example.  This is specially true if you close some of the windows that you had opened last time.

    This mandates that the user visually scans for a window in Exposé every time after invocation and may take a few seconds to visually find a window.  Almost all the time, during a context switch, I take so long to find a window that when I find it, I forget why I wanted to switch to it in the first place---especially if I have to use the space bar to temporarily zoom in to see what that small thumbnail is all about.

    You can rethink it in terms of, for example, comparing it to driving home from work everyday.  When you go home, you don't look at the street names to find out where your home is.  You just know it by position; you simply and unconsciously know which turn to take as you drive.  It is in your spatial memory.  Contrast this to someone lifting your home and placing it in a different neighborhood randomly by 15 miles everyday and sending you its new address before you leave work.  Now you will need a GPS and have to look at which streets you are turning into when you drive home.  This is MissionControl and Exposé my friend.  Takes much longer to find what you need.

    I want to rewrite a variant of WindowScape.  The idea is that _you_ control where each thumbnail goes on the screen.  Each thumbnail stays where you left it and never moves.  You can make is so small that is is barely readable, but you will still know which window it is because _you_ put it there.  This is how the human brain works---by memorizing the spatial position of objects.

    For more, please see the research project:

    http://www.cc.gatech.edu/pixi/wp-content/uploads/WindowScape-Tashman.pdf
  • On Aug 18, 2012, at 11:08 PM, "Glenn L. Austin" <glenn...> wrote:

    > On Aug 18, 2012, at 4:48 PM, Commodore 64 <salmankhilji...> wrote:
    >
    >> Because MissionControl is not spatially stable.  The windows keep moving around and you always have to search for it visually.  Its useless for a power user.
    >
    > Which windows, what what do *you* mean by "spatially stable?"
    >

    I forgot to mention another project that uses spatially stable metaphor.  Basically I want to rewrite MissionControl to be more like TabCandy for Firefox.

    http://www.azarask.in/blog/post/tabcandy/

    Anyone who is willing to help me get started and also participate in coding is more than welcome.
previous month august 2012 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today